Site logo

[Support request] Header Element on custom php search template

Home Forums Support [Support request] Header Element on custom php search template

Home Forums Support Header Element on custom php search template

  • This topic has 5 replies, 3 voices, and was last updated 5 years ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1709861
    Marci

    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?

    #1710099
    Elvin
    Staff
    Customer Support

    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.

    #1710568
    Marci

    I was referring to the Header Element(page hero).

    #1710915
    David
    Staff
    Customer Support

    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.

    #1711039
    Marci

    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

    #1711253
    David
    Staff
    Customer Support

    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 ?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.