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.

How could I split the searchresults into topics.

I have e.g. three Topics - cars | computers | culture

all are "custom post types" .

Now a user searches for term "speed" in the searchbox and the resultpage would be something like this:

cars --- 

2 Posts with "speed" in Cars.
searchresults

computers ---

10 posts with "speed" in Computers
searchresults

culture ---

0 nothing found for "speed" in Cutlure.
searchresults

any way to make this work? Need different loops I guess?

thank yoU!

AD

share|improve this question

1 Answer 1

If your topics are categories, you can use the Search by Category plugin.

share|improve this answer
    
Hi fdsa - thanks for the reply. My topics are "Custom Post Types"....I thought about something like different loops or something... –  ad2003 Jun 21 '12 at 19:09
    
You can put your custom post types into categories. –  fdsa Jun 21 '12 at 19:10
    
If they don't already have categories, you can use register_taxonomy_for_object_type so they are able to use categories. –  fdsa Jun 21 '12 at 19:12
    
thanks for the reply - I checked the plugin page, but I'd like to have a normal search - only the results on the search results page should be grouped. No need to select from a category before the search. thx –  ad2003 Jun 21 '12 at 19:25

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.