How to add Pro Headers and Footers to posts page

Dear Themeco,

I’m trying to add Pro headers and footers to my blog but I keep getting the default “stack” template instead of the ones that I defined. Can you let me know how to set those?

Thanks,
~ Chris

this is the site i’m working on interstoryhq.kinsta.cloud

and the blog is on interstoryhq.kinsta.cloud/ideas

Hi Chris,

There is a trick that you can use to assign the header to archive pages or some non-conventional pages. Here is the tutorial:

The code on your case will be:

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

Change 1234 with the post ID of the header in question. is_home() is the template conditional tag which returns true when the given page is a posts page.

The principle of finding the header post ID is like finding the normal post id which is described here.

The code above should be added into the functions.php file of your Child Theme. if you do not have a Child theme please follow the steps mentioned in this article.

Thank you.

Hmm, Ok. I’ll have a go. Thanks for the update. I do find it a little bit surprising that this is not a built in feature. Who would want to use the default header on their blog page once they’ve built their own headers?

Let’s say I want this header

on this page

How would you modify the code you’ve given me…

Actually the answer was much simpler. I didn’t see these settings:

Hey @cdb788,

Yes that’s correct, you can assign the header to all posts using header assignment section or if you need the header everywhere you can simply make it Global (see screenshot)

Cheers!

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