Hopefully this will help out.
https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
<?php
$args = array
(
'post_type' => 'cars',
'tax_query' => array
(
array
(
'taxonomy' => 'car-types',
'field' => 'slug', //or name or term_id
'terms' => 'suv',
)
)
);
$car_query = new WP_Query($args);?>
<?php if($car_query->have_posts()):?>
<ul>
<?php while($car_query->have_posts()): $car_query->the_post();?>
<li>
<a href="https://wordpress.stackexchange.com/questions/217888/<?php the_permalink();?>"><?php the_title();?></a>
</li>
<?php endwhile; wp_reset_postdata(); ?>
</ul>
<?php endif;?>
Related Posts:
- How to get post content by calling ajax?
- How to properly turn off REVISIONS and AUTOSAVE for whole site and optionally for a custom post type only
- Order by & include array by specific post ids
- Number of pages – multiple (custom) post types
- Limit widget to a specific registered sidebar
- Restrict a Post Types Post Status
- WP_List_Table Inside Metabox Not Working on Submit
- How to filter post data with AJAX on page?
- wp_generate_attachment_metadata gives me an empty array
- Add Capabilities to Custom Post Type after it has been created [duplicate]
- Hook when adding or editing a specific custom post type? [closed]
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- Possible to add meta box to edit.php pages?
- Is there any performance consideration when using Custom Post Types?
- Custom Post Type with static page for archive
- How to filter the description of a custom post type
- Automatically adding meta data to posts or multiple query help
- Make Custom Post Behave Like Normal Post?
- Trigger “unsaved changes” dialog for custom post meta changes
- Conditionally Query Custom Post Types by Post Meta for Blog Home Page?
- Sending an email when a CPT is saved/updated (NOT when it’s created)
- flush_rewrite_rules on every register_post_type?
- Permalinks not working for custom taxonomy on custom post type
- Set up Custom-Post-Type Author Archive
- How to display product subcategories into my custom post type single page
- Adding code to a post under a custom post type
- Problem loading custom post type admin page
- Display content based on a users login
- Custom Post Type Capabilities
- Advanced Custom Fields Plugin – Conflict with Custom Post Type Default Editor
- Custom Post Type And “fopen”
- custom types taxonomy hide_empty
- Custom post type as home page with custom url
- Show image gallery from a custom field
- How to rewrite url for any specific taxonomy?
- WordPress Doesn’t Generate Taxonomy Archive
- WordPress randomly shows 404 errors
- Associate multiple users to custom post type
- Organize WordPress site, so it can maintain with huge database
- How do you create a custom template to display a category with an image and related posts below?
- Order by custom field meta_key date and then by custom file meta_key number
- Remove permalink for custom post type
- Error function query
- custom post data – how to
- How can i link a custom post type thumbnail to intermediate size
- What do the numbers mean at the end of add_action(‘save_post’)…?
- How can I trace inconsistency in loading a template?
- Is there a way to create two template for single custom post type page?
- Get posts from Custom Taxonomy
- post body class for current user only if they are the post author
- display the posts of Custom Post type in custom category
- Custom Post Type archive redirects to home
- postsperpage value not being applied
- Removing numerous Meta boxes from numerous CPTs
- How to rewrite the post slug of a custom post type post
- Meta box data not saving
- Have custom post type Visibility be private by default, and have radio button also set to “Private”
- Custom post type (Jigoshop): unexpected value for $category_id (via $term->term_taxonomy_id) on live server
- custom comment fields on CPT
- Fill custom fields when saving custom post types
- Pagination does not work on Custom Post Type archive while trying to get load more function working
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- Displaying taxonomies as category links within sidebar and creating pages for these
- Can I bind a post_type=’post’ category to a custom post_type category?
- How to exclude categories from a sidebar with active widgets in it?
- Display the link of a custom taxonomy
- pagination for custom post type archive page
- Add custom posts to submenu automatically
- Hide Published text from custom post types column
- Fetching custom post type without knowing post type (REST API)
- Is it possible to get the specific content on the search page?
- Custom taxonomy: on the taxonomy term page show other taxonomy terms
- Get next and prev item from custom WP_Query and Custom Post Type
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Make bootstrap 5.0 carousel dynamic using ACF and CPT UI [closed]
- show label text of select option rather than its value in cmb2
- Custom post categories are not displaying on the page
- Pagination Not Working When Used With WP_Query() `offset` Property
- get_posts wont produce a list of custom type from a given category [duplicate]
- How to create editable sections in wordpress?
- Adding categories to custom post type in permalink
- Get posts under custom taxonomy and custom post type
- Flush rewrite rules when new cpt is registred
- Shortcode in excerpt
- Custom field linking problem!
- Remove custom post type generated by a plugin (The Events Calendar) [closed]
- Show custom taxonomy not in submenu
- Custom Post Type and Custom Taxonomy not connected
- How to Associate Posts with Pages
- URL Rewrite Adjustment for Custom Post Type causes template to revert to index.php
- Custom post type rewrite with_front
- How do I display the index position of a post from a custom post type?
- how to show Author post type count
- What is the code for showing Custom Category and Subcategory Page?
- Url rewrite with custom post type and taxonomy
- wordpress category form fields in popup
- How can I show posts with the same tag?
- How Do I Add a Custom Post Type URL to Content?
- What is the best way to relate different custom post types?