Archived topic
Header Element on custom php search template
5 replies · Started by Marci on March 25, 2021
Hi,
I want a certain header element to show on this page:
https://www.ccasa.org/?sfid=18835&_sft_cm_resource_type=legal-options
It is using php template file search-cm-resource.php.
Right now it is pulling in the wrong header element.
It should match the one on this page:
https://www.ccasa.org/cm_resource_type/for-survivors/
How can I accomplish this?
Hi there,
I'm not sure I fully understand what you mean.
To clarify: Did you mean the Header Element(page hero) or the actual page header which contains the navigation?
The page header containing the navigation looks identical, perhaps its the page hero you're pertaining to?
Let us know.
I was referring to the Header Element(page hero).
Hi there,
are you in control of the search-cm-resource.php template as currently its being recognized as the Blog - theres no body class to show it has its own template tag that could be targetted in the Display Rules.
I've added a body class by adding this in the functions.php
add_filter( 'body_class','bz_body_classes' );
function bz_body_classes( $classes ) {
global $template;
if ( basename($template) =='search-cm-resource.php' ) {
$classes[] = 'search-cm-resource';
}
return $classes;
}
But I don't see a way to target that template in the Display Rules
The problem is that the page is using the Blog template - GP doesn't use body_classes to set where an element is displayed
How is that page / template created ?