I want to make a search page, offering search functionalities by:
1) word
2) tag
3) category
4) author
Can you recommend any technique, any guideline as per how to tackle this?
2 Answers
You’ll want to add some radio buttons inside your search form. Then add a filter to your search:
function filter_search( $query ) {
if( $query->is_search ) {
if ( isset($_GET['tag']) )
// alter your search query here.
}
return $query;
}
add_filter( 'pre_get_posts' , 'filter_search' );
Influenced by http://wordpress.org/support/topic/how-to-add-search-filter-by-custom-values#post-1463329