Home Forums WoodMart support forum Different headers Reply To: Different headers

#268183

Hello,

Try to add the following PHP code snippet to the child theme functions.php file to do this. Replace ids 10 and 11 with your categories ids and header_576762 with header ids.

add_filter(
	'woodmart_get_current_header_id',
	function ( $id ) {
		if ( is_product_category() && is_object( get_queried_object() ) ) {
			if ( get_queried_object()->term_id == 10 ) {
				return 'header_576762';
			} elseif ( get_queried_object()->term_id == 11 ) {
				return 'header_496420';
			}
		}
		return $id;
	}
);

Best Regards