Don’t use query_posts
. Use WP_Query
, and use it’s tax_query
.
$query = new WP_Query( array(
...
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array( 'recent-work', 'plumbing', 'cat3' )
)
),
'posts_per_page' => 1
...
);
Related Posts:
- Get posts from sites in Multisite?
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Using categories & “stickyness” together
- Does the ‘cat’ argument in query_posts fetch posts from subcategories as well as the given ID?
- List posts by category exclude current post
- Display only the latest post from multiple categories
- Select category in custom query
- Display one latest post from multiple categories
- Return category slug / title from category ID
- Exclude category from loop not working
- “NOT ONLY IN” taxonomy query operator?
- Post count for category and tag
- How to query post like normal search would do. within search.php page
- Query Posts Exclude Entire Category
- how to query posts and auto assign category if post title has keyword
- How do I call posts with a certain tag?
- Modify WordPress SQL Query to pull from within a category
- query order by category
- Get link which associated with a specific category and tag
- Order by category titles
- Have parent category contain only one post?
- List posts in alphabetical order
- Randomly load categories with latest post
- Set colors depending on category
- How do I query_posts in cat=1 AND not in cat=2
- List all posts in a category with query_post() function
- query_post order desc
- Exclude a category from a query that includes its parent category
- Show the latest post from child category?
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- query_posts not reading correct categories
- Pagination for query_posts();
- Posts from a category on homepage with category archieves page default css
- function query_posts disabling current_page_menu class
- query_posts by category_name and custom taxonomy
- wordpress taxonomy query posts
- PHP dynamical conditional post display
- Posts of specific category on page and excluded from index.htm
- new WP_Query issues
- how can i hide category?
- Displaying links to all posts of the same category on the post page
- Post not found when filtered by category ID
- Exclude categories from postquery
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Show posts from category specified using a custom field
- query_post problem
- Add class to current post in query_post
- Different post slug based on archive
- Pagination does not work with query_posts()
- Assign a class to first element in category in loop
- How to display products with multiple conditions, product_id and category_id
- Query post only from categories that have subcategories
- Displaying posts by year
- Paginate WordPress Category Pages
- How to have a category not show up in query post with page panigation?
- Query pages by category
- Showing one post from each category, paged?
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- How to add categories to products in woocommerce programatically? [closed]
- Is there a plugin that will completely remove the category system?
- How to get only the last child of category slug?
- Multisite – create a category in specific site
- How do you remove display of WooCommerce product category on single product page?
- Show recent posts in menu?
- Convert the default sub-category dashes to bullets or any other characters
- How to check category of of custom post type or not
- Set a them for all subset of category
- Category pie diagram meta box in post editing page
- Exclude current post from loop
- Exclude categories from wp_list_categories by category slug
- WordPress Categories in data-groups
- How to access deleted term inside delete_product_cat action
- Difference between wp_list_categories and get_categories
- Show different menu on each woocommerce category page
- Have posts that belong to multiple categories, exclude some categories from homepage
- add_settings_field (exclude categories->reading) wp_category_checklist
- Retrieve post tags from from main wp_query
- Listing Post Categories on Home Page
- Get posts in a subcategory of a chosen parent
- How can I only display links from a child category
- Category Template – Show Last Entry as Featured
- How to set the same base url for two different taxonomies?
- Hide category name but show posts
- Count how many posts have a specified tag AND category
- Post List by category and under custom taxonomy
- Balance Tags to the_content Words Length
- How to create template for children category?
- Setting category for post as default
- foreach,having wp_query inside, breaks after showing one result
- Display a category name automatically using code in the functions.php file
- Removing categories, Comments etc from posts?
- Problem importing categories and sub-categories
- how to ask if in two categorys inside if
- How to show video from wp option value?
- Changing Woocommerce categories programatically
- Add an Exclusive or featured tag line to article titles
- How to list out post category name and description in page
- Order Categories by Character Count
- Images as Categories