Pro headers with event calendar pages

Hi there, I’m trying to assign a header to all pages and sub pages built in an events calendar. I just can’t get all of them. for instance this is working http://yeovilrec.bigwave.media/events/
But if I go to here http://yeovilrec.bigwave.media/events/category/athletics/ It doesn’t show the header.

Many thanks in advance if you can help

Lee

Hi There,

First, you have to installed and activated the child theme first: https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57.

Second, 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

That 1234 is the post ID you need for this snippet. Want a custom header on your search results page? Place this in your child theme’s functions.php file:

add_filter('cs_match_header_assignment', 'custom_archive_header');
function custom_archive_header($match) {
	if ( is_tax('events-category') ) {
		$match = 1234; // the post ID for your header
	}
	return $match;
}

For more information about the is_tax function, please take a look at this: https://codex.wordpress.org/Function_Reference/is_tax.

Hope it helps :slight_smile:

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