jecn100 Posted April 18, 2015 Share Posted April 18, 2015 Sorry new to word press coding / php I have a website which has a search function in the header which searches the whole site however I want to add a search function in a category page which only searches in that category. Can i use the current search function but say if in category (directory) only show results for that category? This is what calls the current search function <?php get_search_form() ;?>could I add something in here or do I need to write a whole new search function. Help much appreciated... Link to comment https://forums.phpfreaks.com/topic/295660-wordpress-php-coding-help/ Share on other sites More sharing options...
QuickOldCar Posted April 18, 2015 Share Posted April 18, 2015 There are plugins made for more advanced or category searches. This one should work for you. https://wordpress.org/plugins/search-everything/ Link to comment https://forums.phpfreaks.com/topic/295660-wordpress-php-coding-help/#findComment-1509325 Share on other sites More sharing options...
IThinkMyBrainHurts Posted April 20, 2015 Share Posted April 20, 2015 If you look in the Codex here: https://codex.wordpress.org/Function_Reference/get_search_form and then scroll down to "Theme Form" and see the part where they add an extra hidden element to restrict the search... Link to comment https://forums.phpfreaks.com/topic/295660-wordpress-php-coding-help/#findComment-1509440 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.