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 9 years, 2 months ago by Anonymous.
-
Anonymous(Private) October 8, 2015 at 7:33 pm #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: nothingI 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 selectionsWhat am I missing?
Looking forward to your guidance, Nina
Ross Moderator(Private) October 13, 2015 at 12:25 pm #27196What happens when you
var_dump
$taxonomies
?Is it an empty array returned?
You could just use
if(empty($taxonomies)) { echo "no taxonomy selected"; }
Thanks
-
AuthorPosts