Home › Forums › Add Tags And Category to Page and Post Types › Causes main menu to disappear › Reply To: Causes main menu to disappear
November 9, 2013 at 6:45 am
#2165
Jeremy Blake
Guest
I don’t think there is a bug in the plugin after all. Just make sure to include this in functions.php file and update your custom post type:
function namespace_add_custom_types( $query ) {
if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_type', array(
'post', 'nav_menu_item', '<strong>YOURCUSTOMPOSTTYPE</strong>'
));
return $query;
}
}
add_filter( 'pre_get_posts', 'namespace_add_custom_types' );