Header Assignment

Right now I have 2 different type of Header in my Pro theme let just say Homepage Header for the homepage (assigned to front page) then Post Header for single post (assigned to all post)

My question is why the Post Header appears in taxonomy pages? for example myblog.com/category/foo/
How to make the Post Header only for single post not the archive, not the taxonomy?

Thank you

Hi TheGrey,

You can not assign the header to be only available on single posts and it will include the archive pages. You will need to install the Child Theme and add the code below to functions.php file:

add_filter('cs_match_header_assignment', 'custom_search_header');
function custom_search_header($match) {
	if (is_single()) {
		$match = 1234; // the post ID for your header
	}
	return $match;
}

Change 1234 to the post ID of your header.

For more information on how to find the post ID of the header you want to assign please read the article below:

Thank you.

1 Like

@christopher.amirian that’s what I thought :slight_smile: thank you for the code and reference.

Glad we could help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.