I am trying to display the current WordPress search term on single.php, index.php, and category.php...basically when someone searches for something I'd like WordPress to remember what the last search term was and display it anywhere on my site, is that possible?
The function get_search_query
only works on search.php
Thanks,
Josh
get_search_query
only works on search.php because search.php is used when searching. If you're not searching it won't work as there is no search query to get. This implies a lack of understanding of how the templating system works and how templates are loaded