Genesis Search Results

Community Forums Forums General Discussion Genesis Search Results

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  Jen Baumann 1 year, 10 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6266

    jjohns
    Participant
    Post count: 5

    Is there a quick way to simply add a proper h1 of “Search Results” to the search results page? Everything I’ve come across online seems to be much more involved than I need at this point.

    #6391

    Jen Baumann
    Keymaster
    Post count: 439

    You can try this:

    /* Add Extra Page Title on Search */
    add_action( 'genesis_before_loop', 'search_title');
    function search_title() {
    if ( is_search() ) {
    echo 'Search Results';
    }
    }

    I’m not sure I’d use an h1 though. Your search results title will be the same no matter what is searched for. I usually use an h4 and style it.


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #6464

    jjohns
    Participant
    Post count: 5

    Where would this go?

    #6469

    Jen Baumann
    Keymaster
    Post count: 439

    My apologies. That should go in functions.php. Most code posted like that would go in that file unless otherwise specified. I do notice that the h1 tags I added to that code were removed. You can add them back in around the words Search Results.


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #6707

    jjohns
    Participant
    Post count: 5

    Worked, thank you!  I suspected functions.php but thought maybe it should go in a search template.  When suggesting not using an h1, what did you mean, “Your search results title will be the same no matter what is searched for.”

    #6843

    Jen Baumann
    Keymaster
    Post count: 439

    I meant that h1 really doesn’t have much value on a search page in my opinion. All search pages have the same title so you could have 1000 ?s=search urls all with an h1 of Search Results. It’s really me just being picky :)


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.