You can do it like below-
$query = get_posts(
array(
'category__and' => array(
6, // Your category-1 ID
7 // Your category-2 ID
// And so on and so fourth
)
)
);
Now in $query
variable you’ll get the object of posts which are in both Category 1 and Category 2 and so on and so fourth.
Hope that helps.
Related Posts:
- How do I apply style to each category of a list?
- Redirect to another page using contact form 7? [closed]
- Categories from front-end, checkbox selection doesn’t work
- Visual composer custom element error
- How can I display a list of only categories which are marked as ‘featured’ in the backend?
- Is there a way to combine categories and their hierarchy into the admin listing page?
- How to Display Product specific to a category with WooCommerce Plugin? [closed]
- How can I allow commas in tag names?
- Get the category from an ID of a product?
- Plugin to restrict non-admin user to existing tags
- Combine two taxonomies in a hierarchical tree
- Way to force media uploader use custom image size
- Restrict individual category combinations
- Restrict access and display for categories
- Qtranslate displays empty categories with get_categories()
- How to add terms to a post depending on its title?
- Plugin for changing a post’s category based on it’s post date?
- Plugin to set all Posts in a certain Category to a certain Post Format
- Woocommerce category description as subtitle
- Get subcategories with JSON API plugin
- How to display a category list in a mediawiki like way?
- How to show custom static content at top of each category page?
- How to use get_categories() with Event Organiser plugin
- Server-side subscribe by email?
- plugin for wp_list_categories with posts
- Set a category for a page
- Mixed unrelated taxonomy in permalink
- Show Heirachy of categories in WP Download Monitor
- Custom Post Type Plugin not loading category template and loading 404 instead
- Display content from custom post type if match to main post category
- How can i list random post from multiple category?
- My Category is too big on the Menu what can i do?
- Getting a List of Categories for Use in a Plugin?
- Not able to open category post [closed]
- WordPress category add image field
- WordPress JSON API remove posts from a specific category
- Easy Digital Download Sub category
- Solutions to repost categories into multisite blogs?
- How to display only subcategory
- Category’s Description field as editor remove tag
- Assign post format to categories
- Using WP Category Lists Plugin to Dynamically Display Category (PHP)
- Calendar Solution: Handling upcoming Dates with Posts?
- Events Plugin that works with existing categories?
- Excluding a category from wp_query breaks recent post widget
- Trouble with editing template for “List category posts” plugin
- Any built-in function to associate a post to category through a plugin?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Display by Category in Admin
- Search for categories
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- How do I get fresh post data in post_publish hook?
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- How to Display Taxonomy Custom Meta Box Data in Archive Page?
- Customize permalink wordpress category id
- Enable users to change change and add taxonomies of posts
- How to set taxonomy in custom plugin?
- Automatically Assign Author to Category [closed]
- Custom Pages for Woocommerce Product-Category Pages
- Individual testimonial taxonomy not displaying (white screen)
- polylang + category/tag custom language link
- How to password protect a category page / not posts?
- How to display taxonomy images with wp_list_categories?
- Using arbitrary paths in page urls
- WordPress “Categories to tags converter” not working. Pointing to import.php instead
- How to check if a taxonomy not exists in a plugin
- Recent posts per category loop?
- Taxonomy Drill-Down / Plugin Help – hierarchical queries within plugin?
- How do I rename a category in the menu bar only?
- Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category
- Is changing post from category in a large blog a good practice?
- Best/Correct way to add an option to a category
- How to set category correctly for a custom post created by a remote API call?
- I receive taxonomy id
- .php file for woocommerce edit category? [closed]
- check uncategorized category by default
- Mutliple users editing single document in wordspress
- How to add category and subcategory in WordPress custom code?
- WooCommerce Hiding A Certain Category From Being Displayed On Single Product
- How can recognize post’s category?
- How to get the get the select values created by ACF plugin in wordpress
- How can i listing current category and Featured Category post list?
- How to get Recent Post From Each Category with Thumbnail?
- Category “same post” retreive and display
- how to create hierachial taxonomy and manage under single post type?
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- Add a new category for posts
- How to pre-set WordPress settings for specific posts?
- hide particular category post from front page only [closed]
- How to make horizontal scrolling menu [closed]
- Create WordPress category dynamically
- Can i have limit posts on a specific category and automatically remove older ones?
- jet engine listing for every single taxonomy in post type [closed]
- Failed to update a post when I add a taxonomy to it
- Categories not showing when all of the posts are private
- How to add portfolio category post count in main navigation menu?
- Need a Category List for the category slug
- How can I disable links for categories but keep showing them on my blog in an Elementor Template?
- How to check if the post exists in any of the categories?
- Order Posts Using Taxonomy Term Facetwp [closed]