This can be achieved with Multiple Taxonomy Handling. Try this code.
<?php
$args = array(
'post_type' => 'note',
'tax_query' => array(
array(
'taxonomy' => 'category',
'terms' => array( 'class 11', 'chemistry' ), // Add suitable term slugs here
'field' => 'slug'
)
)
);
$my_query = new WP_Query( $args );
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="https://wordpress.stackexchange.com/questions/204461/<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p><?php
endwhile;
}
wp_reset_query();
?>
Related Posts:
- Simple term-archive-linked Taxonomy Entry output
- List a custom post type’s posts ordered by nested custom taxonomy
- Organize WordPress site, so it can maintain with huge database
- Review site custom post type structure
- Filter get_cat_id for Custom Post Type
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Output terms for custom post types
- Linking from CPT page to taxonomy.php
- Page not found for custom post type UI plugin and taxonomy
- Unable to link categories to custom post type using standard function
- How to Set Taxonomy Object Description?
- Categories and tags for custom post types
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Enable taxonomies by post type in an array of CPTs
- How to assign tag to custom post type in wordpress?
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Rename a slug label
- Custom Taxonomy Category link
- Get Post Terms of Current Post (selected taxonomy term) – How to get only the taxonomy value and not “Array ( [0] => taxonomy term )” in the frontend?
- How to get all Custom Post Type Filtered by one Specific Taxonomy Term
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- How does the ‘the_post_navigation()’ work for CPT’s?
- Custom post type – list posts based on meta_key and display them divided by CPT taxonomy category
- Custom taxonomy (categories) on custom post type return no results
- Filter second dropdown (tax) based on first dropdown (cpt)
- Variable not working in WP_Query
- Hide meta box for everything BUT a certain custom post type
- Archive-posttype.php isn’t loaded
- List of all entries of custom-post-type: Add year-parameter?
- get_category_link() for custom post type does not include custom slug rewrite?
- Add tags to custom post type without menu link
- Targeting categories in custom fields
- How can I create an automatic drop down menu with my tags?
- Associate all Custom Post Types with Taxonomy
- How to define a term for custom taxonomy
- Invalid Taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Need help deciding on a taxonomy
- Alphabetically sort a taxonomy.php template by post title
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- Query all post and CPT from 2 specific taxonomies AND by ACF custom field
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Get Posts by Category, Tag , and CPT Taxonomy
- Show Taxonomies with admin area for custom post type?
- Custom taxonomy template list not working (404)
- Pagination hitting 404 page on /page/4
- Remove categories taxonomy from custom post type
- Use the custom post type archive for taxonomies?
- Rewrite custom post type with taxonomy
- Topic won’t save for a custom post type — how to debug?
- WordPress multisite – is it possible to have different taxonomies for each site?
- Get assigned post categories
- My custom taxonomy is only displaying 1 of 3 terms
- Query custom post types & Taxonomies and list them in a table on a page
- Taxonomy template page not working
- Default Category Page not showing custom post type which has taxonomy category
- Custom taxonomy template shows 404 Error
- How to show list of taxonomy terms associated with specific post?
- Custom Post Type API doesn’t show taxonomy or category array
- Changing CPT slug and taxonomy already registered in parent theme
- How to constrain the results to a specific post_type on tag archive page?
- Shortcode to return single custom post based on post taxonomy
- Creating custom post type posts and associating them with a post from another custom post type
- Sort results without WP_QUERY?
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Group Custom post type in a taxonomy page by its child taxomony
- Categories won’t appear on custom post type
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Custom Taxonomy Terms in Menu lead to which page?
- Getting List of child terms from custom taxonomy parent
- Running a custom query inside another cpt single and trying to grab a variable
- Custom Post Type with modified permalink structure results in 404
- Get posts by category name
- Display 1 Post per taxonomy with polylang
- Custom taxonomy query showing more than 4 posts
- Problems making shortcode with custom post types and taxonomy
- Custom Post Type Taxonomy Term Order by Title
- Using page title as a link to term archive
- Custom Post Types – Taxonomy and Customization
- wp_dropdown_pages with tax_query clause
- Custom Post taxonomy template
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Building a Data Intensive Website with WordPress
- Custom post type, taxonomy and admin bar
- Get post-meta value of all custom-posts – lowest to highest year-count?
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Query Custom Post Type by Taxonomy
- Copying over taxonomy structure from one CPT to another
- Sort Archive by Taxonomy
- Displaying taxonomies as category links within sidebar and creating pages for these
- Query all posts under one taxonomy? Why is my code not working?
- Display ONE taxonomy and its assigned pages
- How to use taxonomy term as permalink folder
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- Can I use the ‘category’ taxonomy for both posts and a custom post type?
- How to get post count of specific taxonomy that have store name & category