Hi,
I see this queries has been posted before a lot of time here. I visited docs as well. My requirement is similar what discussed already.
I need to display just certain categories posts at Home archives.
So I tried this way
add_filter( 'pre_get_posts', 'news_category_home' );
function news_category_home( $query ) {
if ( $query->is_home ) {
$query->set( 'cat', '490, 3286, 36, 3304, 26, 7' );
}
return $query;
}
Exact issue: The problem is it hide my set menus. I tried putting custom link in a test-menu. That also doesn’t appear at all. Means, no menu appear once above code is placed. Only thing I see is header search box in navigation place.
Sadly, happens with Twenty Twenty theme as well.
Is there any nice way to get around it?
Thanks