Forums › Forums › Search & Filter Pro › Echo the query/search term
- This topic has 4 replies, 2 voices, and was last updated 6 years, 1 month ago by Anonymous.
-
Trevor(Private) October 16, 2018 at 11:58 am #191063
Showing the word searched for is not so difficult. If you have other filters, then it becomes a little more complex, but I can give you links. The documentation page:
https://searchandfilter.com/documentation/accessing-search-data/
This thread might help you:
https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/
… and this search will give similar threads I think:
https://support.searchandfilter.com/forums/search/sf_current_query+get_array+field+%5Bvalue%5D/
Anonymous(Private) October 16, 2018 at 12:23 pm #191067I don’t have any other filters, and the first link/example doesn’t seem to work.
<?php
//grab the active query from our search form
//replace1526
with the ID of your search form
global $searchandfilter;
$sf_current_query = $searchandfilter->get(1445)->current_query();
?>This should grab the search term and output it on the page, right?
-
AuthorPosts