Hi Amir,
Thanks for reaching out.
-
Yes, the main purpose of that filter is to override it, and then assigning.
-
You could use it in anyway you want and on any taxonomy, the important part of that code is this
add_filter('cs_match_header_assignment', 'custom_search_header');
function custom_search_header($match) {
/* your condition and ID matching here */
return $match;
}
It’s up to you which condition you’ll add, like what category, taxonomy, and so on. Example
add_filter('cs_match_header_assignment', 'custom_search_header');
function custom_search_header($match) {
/* let's display the same header regardless of terms for custom registered custom-category */
if ( is_tax('custom-category') ) {
$match = 81;
}
/* your custom registered custom-category, with news as term (eg. /custom-category/news/ ) */
if ( is_tax('custom-category', 'news') ) {
$match = 82;
}
/* your custom registered custom-category, with technology as term (eg. /custom-category/technology/ ) */
if ( is_tax('custom-category', 'technology') ) {
$match = 83;
}
/* you could also apply the same header for multiple custom registered taxonomy, like for Woocommerce product with the same term of video */
if ( is_tax('custom-category', 'video') || is_tax('product-category', 'video') ) {
$match = 84;
}
return $match;
}
All in all, the condition is up to you, and you could check other possible conditions that you could use from Wordpress documentation, example https://codex.wordpress.org/Function_Reference/is_tax
- It should be similar but with just different filter, like this
add_filter('cs_match_footer_assignment', 'custom_search_footer');
function custom_search_footer($match) {
/* your condition and ID matching here */
return $match;
}
Hope this helps