Forums › Forums › Search & Filter Pro › Filter on EDD Search Results
- This topic has 60 replies, 3 voices, and was last updated 8 years, 7 months ago by Ross.
-
Ross Moderator(Private) April 6, 2016 at 10:51 am #41768
Hi Adam
S&F doesn’t search tag names, nor does the default WP search – try your “Flowers” test with the old search and you will see (you can search tag names by combining S&F with Relevanssi).
RE the input box, thats the last step we missed!
So, each of the search input fields, that you have changed to be renamed to
_sf_s
, also has avalue
attribute.<input type="text" placeholder="<?php _e( 'Search', 'squarecode' ); ?>" value="<?php echo $searchresults; ?>" name="_sf_s" id="s" />
we need to get the S&F search term into this value attribute. I can see in both your header and search templates, that the query is populated with the value from this line:
<?php $searchresults = get_search_query(); ?>
So all we need to do is get S&F search query into that variable – from the docs you would replace the code above with –
<?php //Get the search term //replace <code>4243</code> with the ID of your search form global $searchandfilter; $sf_current_query = $searchandfilter->get(4243)->current_query(); $searchresults = $sf_current_query->get_search_term(); ?>
Thanks
Ross Moderator(Private) April 6, 2016 at 7:17 pm #41810Ah yes – because its from the frontend some way, the WP filter
save_post
is not firing, which means S&F doesn’t know to update the cache for that post…To get around this, we have an action:
do_action('search_filter_update_post_cache', 23);
Just change the ID to reflect that of the post that has been just updated via the front end 🙂
Thanks
Ross Moderator(Private) April 6, 2016 at 8:22 pm #41818Ah yes, this is because when the S&F form is submitted, it doesn’t have a search field, so doesn’t submit any search string – you need to add a search field to your form, you can then hide it with CSS if you wish, but S&F is not designed to work simultaneously with other fields on a page – however with the changes we have been doing, we are allowing external search forms to redirect to S&F.
Thanks
-
AuthorPosts