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

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)