Search Results Page Header/Footer?

Hello!

How do I set the header/footer for the search results page?

See here for example:
https://silktech.paperjacketmarketing.com/?s=silk

Thanks!

Hi Frank,

Thank you for reaching out to us. I see you’ve already setup the child theme so follow these steps:

  • For the Header, please add the following code in your child theme’s functions.php file:
add_filter('cs_match_header_assignment', 'custom_search_header');
function custom_search_header($match) {
	if (is_search()) {
		$match = 189; // the ID for your header
	}
	return $match;
}

That 189 is the ID you need for this snippet. You need to get the 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 domain.com/x/#/headers/189

  • Same instructions goes for the Footer, add the following code in your child theme’s functions.php file:
add_filter('cs_match_footer_assignment', 'custom_search_footer');
function custom_search_footer($match) {
	if (is_search()) {
		$match = 228; // the ID for your footer
	}
	return $match;
}

Where 228 is the ID of the Footer, you can find it’s ID in the same way.

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Thank you!

1 Like

That worked perfectly! Thank you!

You are most welcome. :slight_smile:

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