Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Search Results Template Title

Viewing 4 posts - 1 through 4 (of 4 total)
  • Celeste
    #10299

    Hello, apologies for the double post but I have two unrelated questions.

    I am using a custom template for my search results page that is an exact duplicate of the regular archive page and taxonomy pages for my products. I have the search form in a partial template that is used in the main archive, taxonomy archives, and search results page. Because of the way the template is structured, the page title is included in this partial template. I am trying to change the page title on the search results page, but am not sure how to target the specific search results archive template. Here is my current code. I would like to add another condition that changes the title to “Lighting Products: Filtered Search” for the search results page.


    <h1 class="product-archive-title">
    <?php
    if(is_tax())
    echo 'Lighting Products: ' . get_queried_object()->name;
    else
    echo 'Lighting Products';
    ?>
    </h1>

    I tried activating the settings “Force is_search to always be true?” so I could use the is_search function, but this is causing problems with my search results. When this settings is active no results are returned for any search.

    Any other ideas how to target the search results archive?

    Thanks!

    Ross Moderator
    #10314

    Hey Celeste

    You could try:

    global $sf_form_data;
    
    if ( $sf_form_data->is_valid_form() )
    {
        //do stuff
    }

    🙂

    Celeste
    #10329

    Thank you Ross, this worked!

    Ross Moderator
    #10339

    🙂

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

The forum ‘Search & Filter Pro’ is closed to new topics and replies.