Exclude custom post type category from homepage

Hi all,

I am using a Strict Themes, Theme Forset theme called Recital.

It uses the following custom post_type, category and taxonomy to define a portfolio homepage layout:


The URL is something like this:

I am trying to exclude a category called ‘wastelands’ which is the tag_ID ‘115’ from showing on the homepage. I have been trying the following code added to the functions.php but it is not working.

Please help…

Very best,


function exclude_cat( $query ) {
	if ( $query->is_home() && $query->is_main_query() ) {
		if ( is_post_type( 'st_project' ) ) {
			$tax_query = $query->get( 'tax_query' ) ?: array();

			$tax_query[] = array(
				'taxonomy' => 'st_category',
				'field'    => 'slug',
				'terms'    => 'wastelands',
				'operator' => 'NOT IN',

			$query->set( 'tax_query', $tax_query );

	return $query;


Hey there, and welcome to the community forums! To get an answer to technical questions regarding items it’s best to contact the author of that item. Please visit the item’s page and write your support question in the item comments. Cheers! :slight_smile: