linkinp 4 Report post Posted September 28, 2012 I need to modify search.php and add some custom code. I need to set a variable and be able to modify the query. How can I do this ? Share this post Link to post Share on other sites
Simon 248 Report post Posted September 28, 2012 There is no search.php in the framework, you would have to filter the search query using pre_get_posts function SearchFilter($query) { if ($query->is_search) { // Insert the specific post type you want to search $query->set('post_type', 'feeds'); } return $query; } // This filter will jump into the loop and arrange our results before they're returned add_filter('pre_get_posts','SearchFilter'); [/CODE] Something like this: Share this post Link to post Share on other sites