More than one search results page template

You could make a page template http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates And then you could post some data via $_GET /search2/?search=xxx to that page and do a custom wp_query where you use ‘s=” . $_GET[“search’] http://codex.wordpress.org/Class_Reference/WP_Query Something like this: $args = array( ‘s’ => $_GET[‘search’] ); $the_query = new WP_Query( $args ); // The Loop while ( $the_query->have_posts() ) … Read more

If search matches taxonomy

I only wanted to match tags in a single taxonomy, so I was able to simplify the code as follows. My taxonomy is ‘post_tag’ — just swap yours out as needed. $i = 0; $search_query = get_search_query(); $term = get_term_by( ‘name’, $search_query, ‘post_tag’ ); if( $term !== false ) { $i++; $single_result = $term; } … Read more

Alphabetical search

Yes. Do a SQL query for posts using LIKE ‘x%’, where x is your letter. Here’s a simple example: global $wpdb, $post; $letter=”a”; // or $_GET[‘letter’]… $query = “SELECT * FROM {$wpdb->posts} WHERE post_name LIKE %s”; $query = $wpdb->prepare($query, $letter.’%’); $results = $wpdb->get_results($query); // note that variable name must be $post, // because you need … Read more

Custom Taxonomy Tag Search

One plugin that I’ve used successfully is Relevanssi: http://wordpress.org/extend/plugins/relevanssi/ Also, you could try to make your custom taxonomy into a search filter, like it’s described in this post: http://wordpress.org/support/topic/search-form-with-custom-taxonomy-dropdown . I’ve used this on my projects and it worked wonders! Hope this helps!

Display just child pages of a certain page in search results

Try the following approach. Get the page using get_page_by_path() http://codex.wordpress.org/Function_Reference/get_page_by_path $page = get_page_by_path( ‘university-guide’ ); $search_query[‘post_type’] = ‘page’; $search_query[‘post_parent’] = $page->ID; The following snippet was taken from Codex page: Creating a search form http://codex.wordpress.org/Creating_a_Search_Page global $query_string; $query_args = explode(“&”, $query_string); $search_query = array(); foreach($query_args as $key => $string) { $query_split = explode(“=”, $string); $search_query[$query_split[0]] = … Read more

Highlight Search Results in Function.php

You can try running the function early so that it runs before the more link is created. add_filter(‘the_excerpt’, ‘highlight_search_term’,1); add_filter(‘the_title’, ‘highlight_search_term’); But I don’t think that solves the deeper problem, even if it were to work. That function is pretty crude and it will replace inside URLs and inside tag attributes, which it should not … Read more

Custom search form to display users only

I am not going to write your form for you, but create a form and submit it to a page to do the processing, or use the AJAX API. Then use WP_User_Query to actually search for users. It is a very WP_Query-like class that should let you do everything you want including search for user … Read more

Custom category search box for WordPress

In every template file of your theme, even in the header.php you can put <?php $term = null; $btn = __(‘Search’); if ( is_category() ) { $term = get_queried_object(); } ?> <form method=”get” id=”search_form” action=”<?php echo home_url(); ?>”> <div> <input type=”text” value=”” name=”s” id=”s” /> <?php if ($term) { $btn = sprintf( __(‘Search in %s’), … Read more