you need the WP_Query Before your Code:
<?php
$allCat = array(
'posts_per_page' => 3,
'tax_query' => array(
array(
'taxonomy' => 'category-products',
'field' => 'slug',
'terms' => 'your-slug',
)
)
);
?>
<?php $all_product = new WP_Query($allCat); ?>
<?php if($all_product -> have_posts()) : ?>
<?php while($all_product -> have_posts()) :
$all_product -> the_post(); ?>
<li><a href="https://wordpress.stackexchange.com/questions/163683/<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<?php endif; ?>
Related Posts:
- How to remove custom post type archive
- How to use a custom post type archive as front page?
- How to make a WP_Query search with custom post types?
- Filtering a custom post type by custom taxonomy in archive template
- create a mostly read only CPT
- Hide/Show only specific categories in wp-admin new-post.php
- Front end registration/login & publish/update 1 custom post
- How can I fix those issues generated by the Themecheck plugin
- Password-protect a custom rss feed
- Custom Post type sort order not working in the admin area
- Post type archive page not working
- Page Templates – this code only works for one Custom Post Type
- Help with hierarchical custom taxonomies and permalinks…almost there
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- How to save the checked boxes?
- How to get only one category of custom post type?
- Adding posts of custom type into the main feed
- Create separate template for shared custom taxonomy with shared terms
- Custom Post Types – How to include custom fields
- Get random custom posts from a custom post type
- Adding new Post through Custom Post Type only offers me “Slug” as an option, how do I get more?
- Return Attachments from Custom Post Type
- How to get attached file in wordpress from custom post
- Bulk edit custom excerpt text in WordPress
- How to add new tab to admin list of posts and handle result list
- Archive Page Not Found on Custom Post Type
- Display custom post type taxonomy and month
- Connecting a taxonomy with a post type
- Customising rewrite rules for CPT single post URL to work as paged URL
- How to achieve representation of streets index with custom taxonomies
- Can’t create more than 5 custom post types
- Pull Two Different Post Types into Different HTML Containers on the Same Page
- How to filter custom taxonomy categories on archive?
- Why my CPT does not appear on the dashboard menu when i activate the plugin?
- “add_post_type_support” with Custom Post Type & ACF
- Problem fields custom date, time, and checkbox
- Insert data on comment post
- Include only recents custom posts in WP rss feed
- Move custom post menu to under plugin admin menu
- custom post type Search returns No Results in admin panel
- Genesis filterable portfolio isotope [closed]
- Adding a custom post type taxonomy template in plugin
- Custom post type “preview” not working
- CPT custom archive template does not get loaded
- Loading custom content type from ajax results?
- Custom post type and taxonomy – show related posts
- How to set up an entity (post-type?) with many dependent entities (more post-types?)
- How do I amend the have_posts function to include custom posts?
- Add custom image size for custom post type or taxonomy
- CPT post count is 0 for the authors in the User list
- Can’t remove front from permalinks for custom taxonomy category page
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- How to make custom taxonomy into drop down select in a custom metabox
- Custom post type RSS feed, multiple post published on same day bug
- Custom Post Archive is not working
- Creat new admin url for custom post type
- disable quickedit for specific custom post type user role
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Pagination doesnt work in custom post type
- Custom REST endpoint not working to retrieve single posts (“rest_no_route”)
- how to create custom post type with dynamic category_name using shortcode
- Why is wp api returning old acf values?
- Pagination on search results page
- Custom Taxonomy Template file not being used
- Custom Post Types and Removing Slugs – should we do it?
- How to display class name in this shortcode post query
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- Taxonomy rewrite pagination 404
- WordPress post carousel
- Display Posts Query with IF function
- Retrieve Custom Taxonomies with Description and Slug
- How to list posts by term (custom taxonomy)
- How to setup different permlalinks for posts and pages?
- Custom Post Type Child Won’t Come Through With Pretty Permalinks
- Change ordering of fields of custom post type in admin page
- Adding accordion-section to custom post type edit screen
- Orderby custom fields is not working
- Random item on Custom Query working Local but not on live
- Custom Page out of Wp Theme
- Filtering posts based on three taxonomies
- meta_query Where the key value is stored as an array
- wp_editor in custom post type is not saving formatted text like bold, italic etc
- Rewrite URL of Specific Post of Custom Type
- Looping through image object using ACF and CPT UI [SOLVED]
- Best way to have one product in both rental and sale parent category
- How do I display specific custom posts, and how do I edit a post’s singular page?
- Unexpected behavior from custom taxonomies
- Listing Custom Post Post from certain category
- How to get past and upcoming post by defining date in custom field?
- How can I include custom post types on a tag page?
- How can I convert custom posts types into regular posts?
- Adding custom post types to the default loop, yet only posts that has terms from the core taxonomies
- Modifying and Displaying URL’s in a Post Template using parse_url
- Post_per_page -1 returns only half the results
- Categories and page filtering with pre_get_posts
- Why the custom post type links don’t work if not login?
- Why is Posts page selected when showing single Custom Post Type?
- register_post_type comment is not working
- Advise on Custom Taxonomies and Structure