Hi neiljordan. You can use the WP pre_get_posts() function in a child theme functions.php file. If you don’t currently have a child theme you can install one using the instructions here:
http://docs.presscustomizr.com/article/239-using-a-child-theme-with-hueman
Add this to your child theme; change the ‘-1’ category parameter to the category ID of your “news” category:
// exclude "news" category from home page
function nj_exclude_category( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '-1,');
}
}
add_action( 'pre_get_posts', 'nj_exclude_category' );
-
This reply was modified 9 years, 7 months ago by
bdbrown.
Thanks for the information.
Ideally I want to “exclude” some sections from the front rather than have to have a specific category to include if that is possible? The items on the front page will come from a number of categories that will be expanding over time, so I would rather not have to list them explicitly, just exclude posts from a small number of categories that will be relatively fixed.
Ah – sorry, I didn’t understand the relevance of the minus in the category number to exclude that particular one.