WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

computers ---

10 posts with "speed" in Computers

culture ---

0 nothing found for "speed" in Cutlure.

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

thank yoU!


share|improve this question

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


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.