Header on Search result page not Global Header

Hi there,

I’m having trouble with the header on the search result page not showing the Global header. I want the global header to be used on my search result page, archives etc.

I’ve tried troubleshooting it and have found that when I set a header to my custom post type “places” it then gives that header to the search result page. I thought the search result page would get the global header.

Do you have a solution for this?

Hi There,

Upon checking your website, I could see that the search page is still using the custom header same as your home page:

Did you mean to set the header of search page to the default header? Or add a section with a background image on the top of search result page. For example:

Regards!

I think I might be having a similar problem. I set a global header shown on our home page - > Ability360.org
I have several other headers built for other pages. When I use the search element in the main header it sometimes changes the header of my website to the other headers I’ve created on the search archive page. As an example, if you click in the search field and type “Marcus” which is a word in one of my pages that have a different header, then it displays a different header on the search archive landing page. That shouldn’t happen right because I set the navigation on the home page to be global.

Hello @LorenAbility360,

Thanks for updating this thread. Since the child theme is set up, 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 = 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 domain.com/x/#/headers/1234

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.

We would loved to know if this has work for you. Thank you.

Thank you very much! That appears to have fixed the problem. Are you going to add this as a fix in the future. This seems like it is a bug or something missing in the development of the header builders. Well if it is not on the books to fix, would you please add it as a feature request? I’m sure there are many others having this problem.

Hey @LorenAbility360,

A featured request has been added and this is under development now. Once our developers finish it, it will be updated and included when we roll out the next release update cycle. Watch out for it by checking our changelog here: https://theme.co/changelog/

Regards.

Hi there,

Thanks for the fix in the child theme functions file, this worked for me great. But yes would be great to see this bug corrected as to my understanding the Global header should be used on all pages of the site that haven’t been otherwise defined.

Thanks

You’re welcome! :slight_smile:

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