Filter post by current 2 differents users id

I'm filtering my custom post type based on author. I want all users to be able to: 1 - in the list everyone can see the posts created by the admin. 2 - users can also see their own posts in the list, but not those of other users. I can list by admin id only or current user id only, but not both. Code: function list_cpt_by_author_id(){ $user = new WP_User(get_current_user_id()); $authors_id = array( array('author' => "1"), array('author' => "$user"), …
Category: Web

Excerpt Length & List Category Posts Plugin

I'm trying to filter out the excerpt by character length for a plugin called "List Category Posts". I've been trying to get the excerpts working for the past week, but nothing is doing the trick. The plugin actually comes with a feature that allows you to post the excerpt or not, then filter it by character length.. by adding "excerpt_size=" in the shortcode. But unfortunately, it doesn't work at this time, and I've tested it with multiple different themes. Anyways, …
Category: Web

Add a new category for posts

I`m new with coding in Wordpress. I try to make a plugin with a widget. When I install the plugin I want it to make a new category for posts. I want the new category named "GiveAway". Name: GiveAway Slug: GiveAway Parent: None When the plugin is finished, I should work like this: When you install the plugin a category called "GiveAway" for posts will be created. If I make a new post and select the category "GiveAway", this post …
Category: Web

Child-Theme Category View with modified permalinks (%category% removed)

I created a new WP Website and added a child-theme to it. The child-theme contains header.php, footer.php and I also created a category.php, in which I show different headers for each category. I figured out, that the urls to the projets are now https://domain.com/category/projects/projects-2009/projectname/ Now I want to remove the category from the url and i am using the 'standard' trick for category removal in wordpress. In my permalinks i set the actual permalinks structure to /%category%/%postname%/ and the category …
Category: Web

Display Posts that fit a certain criteria on Category pages

I wish to display posts that fit a certain criteria on a category page. Something like a search filter applied, to several such category pages. For example, to display all movies by Chris Pratt that grossed over 10 million dollars. Or All movies with Chris Pratt and Zoe Saldana, etc. How / where would I have to look for a good tutorial on how to do the same? Would it go into the realms of custom fields with custom taxonomies? …
Category: Web

Group listed elements by category

I'm quite new to wordpress so there's a lot of terms I'm missing... I'd like to have a list of elements, grouped depending on a category. For example, let's say I have a list of superhero movie names, I want the user to be able to group them either by hero or by franchise. It would look like this: grouped by hero: Iron Man -Iron Man 1 -Iron Man 2 -Iron Man 3 Thor - Thor 1 - Thor 2 …
Category: Web

list category posts - Ability to add anchor jumps to links

Installed this great plugin. Reading through your documentation, I cannot seem to find an option to do the following: The ability to add an anchor tag (url.com/post/#anchorname) to the category listing urls displayed. Say we have 20 links in a category and after each URL have the ability to add a jump anchor tag #. This will be the same anchor tag for all the links in that category (example #downloads or #faqs etc)
Category: Web

Display list of categories filtered by date?

I have a sidebar on our intranet which lists, hierarchically, posts by category. Such as: -- HR ---Events ----Picnic However, this list has gotten long, and some categories are no longer even used. I would like to only category links where there are posts less than a year old. Right now, I am using the default Categories Widget in the sidebar, but I can use a different widget or hand-code it. How would I best approach this?
Category: Web

plugin-list-category-post custom fields

I'm using list category posts and would like to display several custom fields, but not all together. I have used a template to display the list in a table, and have custom fields for country, county and town that I would like to display in individual cells. These are the only custom fields I will be using, so I can hard code the names in the template is necessary. Thanks.
Category: Web

How to display a category from a specific post-type

I have a custom post type called "my_people" along with a custom taxonomy named my_people_categories. It is used to display a list of people. I would like to show only the people in the list that are in a specific category in the custom taxonomy. I have tried using the following short code, but it displays all the people and not just the ones in the categories named. [catlist name=cat1,cat2 post_type=my_people orderby=title order=ASC] Is there someway I am supposed to …
Category: Web

Trouble with editing template for "List category posts" plugin

WP 3.0.4 local installation, multisite network enabled theme: Twentyten plugin: List Category Posts v .15, network activated I've created the folder list-category-posts inside my theme folder, and placed default.php inside it. Edited default.php and saved as lcp_template_1.php inside same folder. However, the changes are not appearing at all. I'm trying to change the style of the lcp output from the default <ul> to <div> classes defined in my theme (child)'s style.css. NOT WORKING. That is, the plugin is functioning, but …
Category: Web

List Category Posts: Output thumbnail and post title within a single link

I've been using List Category Posts for a while to output a basic list of links. I'd now like to make them look more attractive by including the thumbnail for each link and allowing them to scroll horizontally. Using the W3C example as a basis I've created a menu using the following code: <style type="text/css"> div.scrollmenu { overflow: auto; white-space: nowrap; } div.scrollmenu a { display: inline-block; color: black; text-align: center; padding: 0; text-decoration: none; width: 218px; white-space: normal; vertical-align: …
Category: Web

Use main theme's CSS for the outer wrapper in list-category-posts?

All the HTML and CSS shortcode handles are fantastic! I'm able to simply reference my main theme's existing CSS to instantly format the content. What I don't know how to do is formatting the overall list container. How can reference the main theme's gallery CSS and apply a /div class=mygallerytheme/ wrapper around the list? The div needs to sit just above the starting /ul/. (That div also handles the responsive sizing, formatting, etc.)
Category: Web

Format the output of List category posts plugin

I wanted to have the first few lines (say 5 lines) of individual user posts with a particular tag to appear along with their featured image on a particular page. My search for a plugin to do the same took me to your plugin "List category posts" and found that it does things I want but not in a very formatted and exact manner i want. Though the lines in the posts are separate, the plugin shows everything in single …
Category: Web

Display the content of a custom field in the LCP template

Excellent plugin, my only problem is that I can't get the value of a custom field displayed where I want to. I have a custom field: imgx It's value is an HTML code, specifically for an image, like: <img src="mydomain.com/xxx.jpg"> I want to place this left of the post title in the template. How do this? Please post a code sample for the template file. I tried with 'echo', but nothing happens. Thanks in advance for your help! Sorry about …
Category: Web

Custom post template for particular category

Here is my issue: I have one parent category with many sub-categories below it, e.g. Category Sub category sub-sub category...... sub-sub category...... sub-sub category...... sub-sub category...... sub-sub category...... ........ I used the WP dTree plugin to show the categories as a tree. Now I want that when I click any sub-sub category...... that it shows all the posts in that category in one custom post template. I know how to make post template and I know when I make any …
Category: Web

How to Filter categories in the permalink structure

Using /%category%/ %postname%/ for the permalink I get a URL string of all the categories that the specific post is included in. I would like the categories in the url to be filtered down.here it is, I have a celebrity gossip blog and I have this category structure: www.myblog.com/category_1 › sub category_1 ›sub category_2 > Post_name ex: www.myblog.com/pics/a to c/Aniana Lema /myPostName I would like to skip the "subcategory_1,2" in the URL,(only display the parent category) ex: www.myblog.com/pics/myPostName Is it …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.