A taxonomy term page isn’t a post type archive. Use is_tax()
instead. Also, is_main_query()
could be failing because it is not the main query. I know, obvious right. Without the rest of your php code, it is hard to tell. But the “main” query would be the query getting all the posts with that category. If this query is custom, or secondary, is_main_query()
will fail.
Related Posts:
- Order posts by (hierarchical custom) taxonomy terms and term children
- Limiting number of custom posts shown on taxonomy page
- Include custom post type in “all posts”
- pre get posts changing the query
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Using pre_get_posts to Filter Posts
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- how to show records that don’t have custom meta value
- List all posts associated under custom taxonomy
- What’s the most efficient way to get two queries based on an if statement?
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- How to Add Custom Taxonomy To Woocommerce Plugin
- How to get the posts of a custom taxonomy term
- How can I rewrite URLs to pass taxonomy and post type values to the query?
- Custom taxonomy not showing up when adding a new custom post type
- query multiple taxonomies
- wp_set_object_terms() is not replacing term, but creating a new one
- Pre get posts for single post
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Create an archive page for custom taxonomies
- remove support for ‘Categories’ for a custom post type
- How to check if last uri segment is a custom post type or taxonomy term?
- filter search result with custom post type meta key
- Categories under custom post types doesn’t show properly
- Hide child term posts on parent term pages
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- get a list of posts from Custom Taxonomy
- Want to filter only parent post in admin area
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Trying to manage templates on a blog with lots of custom taxonomies
- Display custom taxonomy as dropdown list
- Automatically Add a Category to a Custom Post Type
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Query to change custom post type with specific category
- Custom post type and taxonomy permalinks – Structure
- Best action hook to create custom post and assign taxonomy terms to it on plugin activation?
- Custom Post Type and Custom Taxonomy Permalinks
- How many Custom Post Types to register?
- pre_get_posts on custom post type
- Insert HTML inside link in a walker
- Set menu active state for custom posttype and category, given custom taxonomy term
- How to bulk copy custom fields between custom posts?
- get_attached_media() on author page not working
- CPT UI change custom taxonomy url
- Custom post type structure for posts with multiple child posts
- Multiple meta_values in the pre_get_posts filter?
- Search / Filter posts on Title/Content OR Tags
- Show posts from two or more custom taxonomy terms
- Hide parent categories when clicked, and show it’s childs
- Custom taxonomy and custom post type – wrong permalinks and template
- Auto Complete Search
- Custom taxonomy returns 404
- Displaying Custom Taxonomies From Multiple Custom Post Types
- Display and register custom categories for custom post types
- Properly flush rewrite rules on plugin activation
- Adding predefined terms to a taxonomy
- Loop to display custom post type from a custom Taxonomy
- Redirect to archive is single post has a certain term assigned to it?
- Custom query – get_the_terms not work
- Custom taxonomy page returns 404
- portfolio custom type tags support
- Custom taxonomies to define versions of a product
- How to select a template for a custom post type?
- Targeting custom post type via functions.php doesn’t work
- Custom post type and taxonomy cross registration [duplicate]
- Custom taxonomy not saving correctly
- Display a random customposttype2 excerpt in single-custompostype1.php that shares same taxonomy
- Custom Post Type Rewrite Throws Headers Sent Errors
- Custom archive page for custom taxonomy and pagination issue
- Ordering by meta value not working
- Custom taxonomy does not display in custom post loop
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Return multiples taxonomies with wp_get_object_terms
- How to add CSS class field in Custom Taxonomy?
- Display Specific Posts at Start of Loop
- How can I output a post’s custom taxonomies to a two column list?
- Pagination with a custom post type
- taxonomy – templates are not loading
- week days sorting based on starting day
- One-Time Script TimeOut for Large Data
- CPT Efficient way to display posts from different categories with custom query
- Associate custom categories to different user IDs
- How to create default taxonomy term for a custom post type? [duplicate]
- Extensive search filtering and results->PDF in the front-end
- archive-{custom_post_type}.php not getting recognized wordpress
- How to retrieve the permalink for a specific (custom) term?
- Values inside a custom field to determine which category posts to display
- Taxonomy and Rewrite Structure
- Pagination for a Custom Taxonomy
- Trying to create hierarchy between 3-4 custom post types
- How do I sort post listing by child post count?
- title tag for custom post type remove taxonomy name from title tag
- Create a page selector using taxonomies
- Advanced search form with filters for custom taxonomies and custom fields
- Only One Post of Custom Post Type Appearing on Template Page
- Code to show related posts (custom post type and custom taxonomy/category) is messing with other code
- register_term_meta not working
- Limit taxonomy terms added to a custom post type
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes
- Dynamically count the number of custom post types associated to a custom taxonomy