Custom Woocommerce Headers worked on Staging but not Actual Site

Thanks to support help, I successfully assigned custom headers to woocommerce category pages to my staging site: Pro Headers in Woocommerce Shop Category Pages by adding this snippet of php code to my pro child functions file:

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

Success here:
https://vpzry3xn2p3.c.updraftclone.com/product-category/original-paintings/oil-paintings/

However, when I replicated this after installing pro on my site and downloading/installing all header templates (this is working beautifully so far), I did the same thing and making sure I am assigning the correct new header id (7916), it didn’t work.

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

Fail: https://www.amytwon.com/product-category/original-paintings/oil-paintings/

Note that this page currently has a global header assigned because I can’t leave without header.

What am I doing wrong? Thanks!

Hi @rotipom,

Those custom code needs to be added on child theme functions.php. On your staging site, it is working because child theme is active. On live, I can see child theme is not active. Please try to activate child theme, clear cache and then check again.

Let us know how this goes.

Oh I forgot to activate, hah thank you! It’s working now!

You are most welcome!

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