Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to be able to search a particular custom post type on my blog. The custom post type is named: website_bookmarks

I have modified my search form with a hidden field

<input type="hidden" name="post_type" value="website_bookmarks" /> 

So on my search page in the URI I will see...

www.mydomain.com/?s=mysearchterm&post_type=website_bookmarks

The problem is it ONLY shows search results for my regular blog post and no results from my custom post type.

It should not be showing any results for my blog post and ONLY results for my custom post type website_bookmarks

Can someone help me? I can not figure out why it will not work and it will work on other people blogs simply by changing the search form to what I did above.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Could you check one thing for me: http://codex.wordpress.org/Function_Reference/register_post_type

When you register website_bookmarks is:

exclude_from_search

(boolean) (importance) Whether to exclude posts with this post type from search results.

Set to false?

share|improve this answer
    
hello, thanks for reply, and yes I have that set to false and public, public_queryable,show_ui, query_var all set to true, it is a strange issue –  jasondavis Sep 26 '11 at 9:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.