Title: separate search function
Last modified: July 5, 2021

---

# separate search function

 *  [joyce2020](https://wordpress.org/support/users/joyce2020/)
 * (@joyce2020)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/)
 * Hi,
 * I am trying to have a separate search function for the two search bars on this
   page.
 * For the search bar on the top, I want to keep it working as it is to search for
   products.
    For the search bar on the right hand side, I want this to search for“
   posts” only, to only display blog posts in the results. I had a developer that
   input the codes to have this separate function, but it has stopped working, and
   no results are returning for this search bar.
 * in contents.php, I found the following codes:
    `<?php if ( 'post' == get_post_type())://
   Hide category and tag text for pages on Search ?>` I’m not sure if this is relevant
   to defining this search bar.
 * Can anyone please give me some advise on how to fix the right hand search bar
   to only display blog posts?
 * Thank you very much.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fseparate-search-function%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14625573)
 * If it’s custom code, we don’t know what it’s doing. It’s best to ask the author.
 *  Thread Starter [joyce2020](https://wordpress.org/support/users/joyce2020/)
 * (@joyce2020)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14625615)
 * Thanks [@joyously](https://wordpress.org/support/users/joyously/)
    We can’t get
   a hold of the developer, is there any way we can override what he has done to
   make the blog search function work?
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14627338)
 * You could, and fix it, if you knew what was what.
    The code you quoted is only
   about displaying the category and tags on the search page. It’s not about the
   search itself, which is handled by WordPress (unless it is filtered by custom
   code like a plugin).
 * You can isolate where the code is, using the [Health Check](https://wordpress.org/plugins/health-check/)
   plugin in Troubleshoot mode. This allows you to disable theme/plugins **for your
   user only**. Once you know if the code is in the theme or a plugin, you at least
   know what code you can replace with a different plugin to modify the search. 
   Or you can find someone at [https://jobs.wordpress.net](https://jobs.wordpress.net)
   to figure it out.
 *  Thread Starter [joyce2020](https://wordpress.org/support/users/joyce2020/)
 * (@joyce2020)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14629157)
 * Thanks [@joyously](https://wordpress.org/support/users/joyously/)
    I checked 
   my plugins, the only search related plugin I can see is “YITH WooCommerce Ajax
   Search Premium”, which controls the search bar on the top of the page which searches
   for products. I think the search bar on the blog page on the right hand side 
   has been edited by custom coding in the theme file. If you can point me to the
   direction of where or how to find the blog page template with this search function,
   I would really appreciate it. Then I can do some experiments with changing the
   codes for the search function. Thank you very much for your help.
 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14629180)
 * Themes don’t have functions in template files, so the code might be anywhere 
   else. If the theme is totally custom, you should ask the author.
    If it’s from
   the WP repository or bought somewhere, then you can use a comparison program 
   to compare the files that are on your site with the original files of the theme.
   Or if you have a child theme, it’s probably in there. Or it could be code in 
   a custom plugin (it belongs in a plugin, not a theme). Again, Health Check can
   help you isolate it.
 *  Thread Starter [joyce2020](https://wordpress.org/support/users/joyce2020/)
 * (@joyce2020)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14629217)
 * Hi [@joyously](https://wordpress.org/support/users/joyously/)
    Thank you for 
   your response and help, I really appreciate it. I’m quite sure the search plugin
   installed isn’t affecting the blog search for posts. I’ll look through the child
   theme for the custom code. What would you say is the best term to look for?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘separate search function’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 6 replies
 * 2 participants
 * Last reply from: [joyce2020](https://wordpress.org/support/users/joyce2020/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/separate-search-function/#post-14629217)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
