Changing page title when no search performed on archive page

Forums › Forums › Search & Filter Pro › Changing page title when no search performed on archive page

  • This topic has 3 replies, 2 voices, and was last updated 11 years ago by Anonymous.
Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #26900

    THANK YOU so much Ross for helping with my prior questions that are now RESOLVED.

    Now I moved my Resources section that uses Search and Filter Pro live http://leadernet.org/featured-resources/ The search output goes to post type archive http://leadernet.org/resources/ .
    When no search is performed I need this archive page title to say “Showing results for all resources” vs YOU SEARCHED FOR: nothing

    I can’t figure it out.
    I can check for the length of of my text entry $my_search_term
    I’m lost trying to have an indicator of none of taxonomy checkboxes being selected.

    $my_search_term = $sf_current_query->get_search_term();
    $taxonomies = $sf_current_query->get_fields_html($fields, $args);
    echo “<br> search term length is” . strlen($my_search_term); — is 0 when none in text box
    echo “<br> term array length is” . count($taxonomies); — always 1 no matter selections

    What am I missing?

    Looking forward to your guidance, Nina

    Anonymous
    #27114

    Dear Ross,

    any guidance? Please help as we’re going to present the section in next several hours.

    Thank you again, Nina

    Ross Moderator
    #27196

    What happens when you var_dump $taxonomies ?

    Is it an empty array returned?

    You could just use

    if(empty($taxonomies))
    {
        echo "no taxonomy selected";
    }

    Thanks

    Anonymous
    #27238

    That worked! Thank you Ross! I was able to output the title conditionally.

    truly appreciate your help Ross!

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

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.