Return all Tags from search results

The global $wp_query object is available before you call have_posts(). All you have to do is running through this object’s posts member with get_the_terms(). Sample function: function get_query_terms( $taxonomy = ‘post_tag’ ) { $list = array (); foreach ( $GLOBALS[‘wp_query’]->posts as $id ) { if ( $terms = get_the_terms( $id, $taxonomy ) ) { foreach … Read more

How to stop _wpnonce and _wp_http_referer from appearing in URL

This issue arrises because of a couple of problems: 1) WP_List_Table::search_box() inserts the default _wpnonce and _wp_http_referer fields by using wp_nonce_field() without giving you the ability to override and say “I’ve already go a nonce field thanks”. 2) You need to use GET as your method of form submission when subclassing WP_List_Table because WP_List_Table::print_column_headers() only … Read more

Create multiple Search functions for posts / custom post types and everything

you can change your search filter to this: function SearchFilter($query) { $post_type = $_GET[‘post_type’]; if (!$post_type) { $post_type=”any”; } if ($query->is_search) { $query->set(‘post_type’, $post_type); }; return $query; } add_filter(‘pre_get_posts’,’SearchFilter’); then on your news search form add : <input type=”hidden” name=”post_type” value=”post” /> on your custom post type listing search form add <input type=”hidden” name=”post_type” value=”customtypename” … Read more

How to redirect search result page to post

I think it is better that you do this inside the WordPress install, not on the .htaccess. Is not easy to maintain and maybe a problem, if you have more results for a search. You can use the follow source, write in a small plugin and activate. If the search result have only one result, … Read more

Include custom table into search results

It’s probably SQL Full Text Search what you’re looking for. Maybe this tutorial helps you forward: http://www.blrf.net/howto/49_Wordpress__How_to_implement_MySQL_full_text_search_.html There is also a WP plugin with Full Text Search capability, but it’s not updated for a while: http://urbangiraffe.com/plugins/search-unleashed/

Change the Search Base in a multi language wordpress

I found the solution. I had to flush rules after I change the search base with the code on the edited question. Here is the final code: $lang = get_bloginfo(“language”); if ( $lang == ‘de-DE’ ) { add_action(‘init’, ‘search_base_german’); function search_base_german() { $search_slug = ‘suche’; // change slug name $GLOBALS[‘wp_rewrite’]->search_base = $search_slug; $GLOBALS[‘wp_rewrite’]->flush_rules(); } }

Combining Meta_Query key values for one array

What if you use IN operator and split the search term in a words array: $args = array( ‘role’ => ‘Subscriber’, ‘meta_query’ => array( array( ‘key’ => ‘membership_class’, ‘value’ => ‘Full’, ‘compare’ => ‘=’, ‘type’ => ‘CHAR’, ), array( ‘relation’ => ‘OR’, array( ‘key’ => ‘first_name’, ‘value’ => explode( ‘ ‘, $usersearch ), ‘compare’ => … Read more