altering search terms

You can use parse_query: function wpa64292_parse_query( $query ) { if( isset( $query->query_vars[‘s’] ) && !empty( $query->query_vars[‘s’] ) ) $query->set( ‘s’, prepSearchStr( $query->query_vars[‘s’] ) ); } add_action( ‘parse_query’, ‘wpa64292_parse_query’ ); Note that it won’t alter the query string you see in the browser, but if you echo get_query_var(‘s’) in your template you’ll see it’s been altered.

Can I make a search query which includes a space?

If it is possible at all, this is how it would be done: $searchquery = new WP_Query( array( ‘s’ => ‘hello ‘ )); Since all queries boil down to WP_Query at their most basic level, we can determine if it is possible using the WordPress APIs by looking at the code in wp-includes/query.php // If … Read more

Only display post content in search results

Some themes like Twenty Fourteen include a template tag included in the content.php file for entry meta which includes the author and date: Example: twentyfourteen_posted_on(); The content.php file also includes the_title() tag so you need to remove that if you don’t want the entry titles displaying on your search result pages. The search.php file includes … Read more

Does search.php autofilter The Loop?

The loop doesn not display the latest posts, it just shows the posts the main query has found. On your search page the main query returns search results, and you can change its order (we have plenty of examples for that on our site). WordPress looks for the parameter s or /search/ in the request … Read more

Specific website content

You will want to register custom post types for each of the sections (books, articles, etc). Your post types should be registered as a custom plugin so that they can be kept in the case you decide to switch your theme. Custom post types: http://codex.wordpress.org/Post_Types WordPress plugin API: http://codex.wordpress.org/Plugin_API The advanced search is a bit … Read more