Hi,
I am working on new version where you can have multiple forms with multiple settings.
Meanwhile, you can replace search-type with post_type and the value of this field should be the post type name e.g.
<input type="hidden" name="post_type" value="page" />
to search only pages.
WPES respect that “post_type” query strings and displays only posts from value of this field.
Thanks
Sumit- Thank you for replying, but I don’t think this helps. I have two search forms, each with a hidden field of search-type, and two search files (search-blog.php and search-members.php). Search-blog.php searches blog posts and search-member.php searches only member pages (this is a membership site). My theme’s search.php file has the following code so WordPress know which search file to load.
if(isset($_GET[‘search-type’])) {
$type = $_GET[‘search-type’];
if($type == ‘blog’) {
load_template(TEMPLATEPATH . ‘/search-blog.php’);
} elseif($type == ‘members’) {
load_template(TEMPLATEPATH . ‘/search-members.php’);
}
}
I like your plugin because for my member page search, I can specify the search only on title and meta keys, and not the content, which is something I can’t figure out how to code on my own (my custom search includes the content of member pages, which I don’t want). But I can’t figure out how to use your plugin for my member page search, and also have a separate standard search for blog posts.
Okay, I got it now.
Currently you can have only one setting for all searches. (This will be changed in future.)
I can suggest you keep using WPES for Member search and disable WPES for blog search.
To disable the WPES for blog page use the hook wpes_enabled
Check for search-type like you are checking here and return false.
$type = $_GET[‘search-type’];
if($type == ‘blog’) {
return false;
}
Let me know if this helps.
Sumit-
I was unable to get that to work. However, I found this code on a “hooks” site, which I put in my functions.php file:
function wpes_enabled($enabled) {
if (!empty($_GET[‘disable_wpes’])) {
return FALSE;
}
return $enabled;
}
add_filter(‘wpes_enabled’, ‘wpes_enabled’);
And I added the following input to my blog searchform:
<input type=”hidden” name=”disable_wpes” value=”true” />
Now, my member search uses the WPES plugin and my blog search does not, which gives me what I want.
Good to know if you want to use WP Extended Search with blog search as well then please take a look at this topic https://ww.wp.xz.cn/support/topic/wp-extended-search-2-0-beta-1/