Need to do blank search.

When there is no value for parameter “s” , it redirects automatically to homepage. Instead of this , I want to show all the information from my custom sql query. how can i do this?? 2 Answers 2 You can pass s=%20 as your search string, but thats kinda hackish. If what you are trying … Read more

pagination hook doesn’t work with search results

I use my custom Pagination function on my web site; #Pagination function pagination($prev = ‘«’, $next=”»”) { global $wp_query, $wp_rewrite; $wp_query->query_vars[‘paged’] > 1 ? $current = $wp_query->query_vars[‘paged’] : $current = 1; $pagination = array( ‘base’ => @add_query_arg(‘paged’,’%#%’), ‘format’ => ”, ‘total’ => $wp_query->max_num_pages, ‘current’ => $current, ‘prev_text’ => __($prev), ‘next_text’ => __($next), ‘type’ => ‘plain’ … Read more

Make Search Function include subdomain (blog.ourwebsite.com)

Wondering if there’s a way to edit our search.php or .htaccess or function.php (or anything else…) so that our search function on our main site (www.oursite.com) includes the subdomain of blog.ourwebsite.com? Any thoughts or suggestions are appreciated it.. 1 Answer 1 If you transform your main website’s WordPress into a multi-site environment, you can move … Read more

Including only current user’s posts in search

I am a new WP plugin developer. I want the search page to include only the current user’s posts. I first added a new capability read_others_posts to only administrators and editors. Then I tried the following code, placing it in a function and hooking it to the pre_get_posts action: if( !current_user_can(‘read_others_posts’) ) $query->set( ‘author’, get_current_user_id() … Read more