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

i have attached custom taxonomies to posts.

now i'm looking for the best way, architecturally speaking, for automatically creating list that would look like this:

energy (32):

  • how to build a solar system (asaf)
  • how to fix a solar panel (saar)
  • managing your lead-acid deep-cycle battery (ofra)
  • hybrid system design (asaf)
  • take the green pill (saar)

more energy? ->

explanation: it should query all instances of a specific taxonomy (let say tags, and afterwards i'll do the same with other taxonomies as well) and make a list of that will have the tag name as a title with number of posts in the tag in brackets, and a list of the newest posts under that list with the author name in brackets.each post should link to the post, and name of author should link to the author page. in the bottom it should have a generic link to that specific tag archive page.

the function i'm trying to build should generate that list automatically for every tag that has more then 10 posts tagged.

the next difficulty level is to make it show every post only one time (for posts that are tagged with number of tags it will show the post only on the first tag).

i've tried to find a plugin that i can tweak to doing that but i could not find any thing close enough, so i decided to build it myself. what i'm asking is for everything between a a tip for the road and a "yesterday i've developed the same function, it's working great, here's the code. have fun".

Cheers, Asaf.

share|improve this question

I think this is a custom code job.

But here is the query logic I'd use to build this.

  1. do a get_terms() for your custom taxonomy.
  2. Loop through each term
  3. Inside loop do a query_posts() for posts with that taxonomy excluding previous post ID's and limiting the return to 10.
  4. If 10 posts are return then show tax title and then list the ten posts titles using the_title() and the_permalink().
  5. Make sure you have a variable that holds post ID of displayed posts so to exclude them on the next tax.

If you need help with code for any of those bits then leave a comment and I'll be sure to add to my answer.

share|improve this answer

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.