Pro Header on search results page


I have 2 pro headers. One that i want to use for all pages except for the home page, and one for the homepage itself. Currently the search results page just uses the built in header and not a pro one. How can i specify a global header which i know should cover the search pages / posts but have a different one on just one page. I hope this makes sense.

Thanks guys

Hi There,

To achieve that, you have to setup a child theme first:

After that add this code under functions.php file locates in your child theme:

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

That 1234 is the post ID you need for this snippet. You need to get the post ID of the header you’d like to assign. The easy way to do that is to simply hover over the Edit link in the builder, and take a look at the URL in your status bar. It should look similar to

Hope that helps and thank you for understanding.

Hi @thai. Works perfectly thank you :slight_smile:

You’re welcome!
We’re glad @Thai were able to help you out.

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