I have a made a custom post type called "Member Resources" the posts under this CPT have a few taxonomies such as categories and tags.
Tags = "Diversity" Categories = "Guidance"
When I go to the following urls:
www.domain.com/tags/diversity
www.domain.com/tags/guidance
No posts appear.
Though I have set public => true on the CPT function.
Posts are displaying if you go to the Member Resources archive page though, so they are displaying, but not when you filter them by taxonomies.
Any help would be appreciated!
Thanks.
add_action( 'pre_get_posts', 'add_my_custom_post_type' ); function add_my_custom_post_type( $query ) { if ($query->is_main_query()) $query->set( 'post_type', array( 'member-resources' ) ); return $query; }
This works a charm, so it seems. But I'm baffled why, by default my custom post types are not being shown in tags and category pages? I have even registered them in the CPT. Could anyone explain why this is?