Your issue is definitely caused by the lack of a pre_get_posts
filter. Try this in your theme/functions.php
:
// so event cpt is found on assigned cat archive page
function jdk540_event_query_post_type($query) {
if ( ! is_admin() ) {
if( is_category() || is_tag() && $query->is_main_query() && empty( $query->query_vars['suppress_filters'] ) ) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array( 'post', 'event', 'nav_menu_item');
$query->set('post_type', $post_type);
}
}
}
add_action('pre_get_posts', 'jdk540_event_query_post_type');
Related Posts:
- WP_Query by a category id and a custom post_type
- Exclude a category from WP_Query
- WP_Query ignores post_type in category view
- category__in not working on custom post type
- List with categories, subcategories and posts of custom posttype
- New WP_query in template not working with CPT+category on some pages
- WP Query group/order by category name
- List all custom post type posts from a given category?
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts
- Query Custom Post by Category
- Loop through categories and create tab for each
- Getting all custom posts with a certain category
- Query Custom Post Types & category_name?
- Show Post Count of a Category
- CPT posts listed by category with custom rewrite URL, please help!
- Querying Term Posts in Loop
- Pagination on category page with custom post types
- How to show CPTs in term archive
- showing custom post types of a certain category only
- Linking to the most recent post in a Custom Post Type
- Show custom post type filtered by category
- forming WP_Query for posts of all post types but from specific categories
- WP Query with categories only shows one post and ignores the category
- WP the_posts() on single-cars.php get category link
- WP_Query Custom Post Type if Category ID Equals
- Custom post types and ‘new WP_Query’
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- List categories, subcategories and posts from custom taxonomy and custom post type
- WP Query results showing posts outside of category ID
- How to get Custom Post Type with Categories wise in WordPress using wp_query
- Create query for both custom post type and category
- How to properly use Categories with Custom Post Types
- How to output custom post type title on custom page with category next to it?
- Custom Post By Category
- Only show categories that have posts within custom post type
- Query the title of the page to show posts with matching category in the loop
- Only show current category post
- Can’t seem to filter wp_query by current category ID
- Custom Post Type + Category archive
- category_name not working in WP_Query
- Get all custom_post_type posts + blog posts from one category in a single query
- Using tax_query to get single post per category
- Are custom posts included when getting a categories’ posts?
- Is it possible to make is_category() recursive?
- How to display regular posts & custom post types that fall under a category using just the generic category template?
- How to filter custom post types by custom category taxonomy
- Remove date and category filters when editing custom post types
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Using Query Posts With Multiple Post Types And A Taxonomy
- Anyway to assign custom post types to a specific category?
- Custom Taxonomy List links being re-written
- wp_list_categories and custom post types
- Can’t sort order of wp_query with 2 meta keys
- Get count of custom post type created by current user
- How can i list custom post type categories?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Custom post query by taxonomy
- Add category in post type dynamically
- Group custom posts by custom taxonomy names
- Use regular category with custom post types
- Can’t query tag and post_type at the same time
- Wrong request query on cpt and tax
- Separate custom categories from default category
- Converting the_content string to an array?
- Cannot add category or custom taxonomy from admin. WordPress site is hosted in Windows 16 server via IIS. No XAMPP or WAMP
- Custom post type, organized by categories
- Advanced search form with filters for custom taxonomies
- Showing specific post in order of array wp_query
- tax_query not working in template
- Custom WP_Query always respond with 200 status even when no entry
- Pagination 404 on Index with custom query
- Displaying Custom Posts
- Include custom post type custom taxonomies in Categories widget
- Trying to add a class to post links
- WordPress custom post categories and subcategories on category.php
- Two queries – one with checkbox ticked, one without – comparing meta_query
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Display Parent-Child Posts in specific order by comparing IDs in array
- Apply category query clause to posts of custom type
- SEARCH QUERIES – REVERSE OUTPUT
- WP_Query to display number of custom post type filtered (order by) taxonomy
- 2 modal windows with ACF content on Archive page
- post_type incorrect for custom post type
- Live search by custom tag
- Set a Default CPT taxonomy by taxonomy id
- Custom Post Type – Display all, wrap in groups of 3
- how to create custom taxonomy drop downs for parents and child
- How to get the posts that my following users are liked?
- How to create groups like that in buddypress?
- Display all Custom taxonomy terms and their relevant custom posts
- Getting list of Categories for Custom Post Types
- CPT or Custom Table for Repository of Serial Numbers
- Query Pulling the same post twice
- I have a custom post type that I want to query a dynamic category name from a custom meta field
- Custom post-type’s pagination not working in category.php
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Assign a tag to custom post type using a query
- Categorizing Custom Posts in Bulk Based on Title
- Query order by a numeric ACF field