include user profiles in search results?

I haven’t an ready to use solution. However I think you should enhance the query, so that you have the field of the users inside this. I think the follow example demonstrate it more. The two filter hooks are necessary and get an result for the query like this: SELECT SQL_CALC_FOUND_ROWS wpbeta_posts.ID FROM wpbeta_posts JOIN … Read more

Better search for WordPress admin backend [closed]

The Search Everything plugin works pretty well for me on the front end. I’ve never tried it, but you should be able to fork it and add is_admin() conditionals to all of the functions it uses. Or better yet, just allow the frond-end to be search-able too. A visitor who can find what they are … Read more

wp_nav_menu() not working on Custom Search Page

I know this is an old thread but the problem still exists. I think this is a bug. Default queries such as nav should not be affected in making custom search page. Anyways, this is how I fixed it: function fix_nav_menu_in_search($query) { if (is_search()) { $query->set(‘post_type’, [‘your_cpt’, ‘nav_menu_item’]); } return $query; } add_filter(‘pre_get_posts’, ‘fix_nav_menu_in_search’);

How to allow user to perform search by more than one tag

Firstly, stop repurposing categories and tags, instead use custom taxonomies. This will give you: archives and listings URLs to view each taxonomy User interfaces that match the names I would personally have chosen a physician custom post type with specialty and location taxonomies. However I am assuming this is a way of filtering down posts … Read more

How to customize search result page title?

Within the wp_get_document_title() function we have: // If it’s a search, use a dynamic search results title. } elseif ( is_search() ) { /* translators: %s: search phrase */ $title[‘title’] = sprintf( __( ‘Search Results for “%s”’ ), get_search_query() ); so you could hook into the document_title_parts filter to adjust it to your neds. Example: … Read more

Custom Search Page Pagination Not Working

You’re running into a conflict between your replacement query and the default search query that’s running behind the scenes. Instead of running a new WP_Query, try modifying the default query by hooking to pre_get_posts: function wpse276396_search_filter($query) { if ( !is_admin() && $query->is_main_query() ) { if ($query->is_search) { $text = urldecode( get_query_var(‘search_text’) ); $my_products = aws_search_byozan($text); … Read more

Add custom field (value) to search result (without plugin)

WordPress search in posts table. You must change the search query by adding a postmeta table (with LEFT JOIN) and then add your own conditions to WHERE clause. <?php /** * Extend WordPress search to include custom fields * * https://adambalee.com */ /** * Join posts and postmeta tables * * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join */ function cf_search_join( … Read more

Restrict a search to a custom post type

You can restrict a search to a custom post type by modifying a basic WP search form like this: <form id=”cptsearch” action=”<?php echo home_url(); ?>” method=”get”> <input type=”text” name=”s” /> <input type=”hidden” name=”post_type” value=”POSTTYPENAME” /> <input id=”searchsubmit” type=”submit” alt=”Search” value=”Search” /> </form> To select a specialized template for the custom post type search, add this … Read more