Support » Fixing WordPress » Looping through / Grouping by Sub-Categories

  • I have posts under the following category structure:

    — Alaska (5 posts)
    — Antarctica (2 posts)
    — Arctic (0 posts)
    — Asia (1 posts)
    etc. etc.

    I’m looking to create a custom loop that “loops” through all the sub-categories (under Destinations), displays the category name (if posts exist under that category – as a header), then the post titles under that category.

    Example of my expected code output:

       <li>Alaska post #1</li>
       <li>Alaska post #2</li>
       <li>Alaska post #3</li>
       <li>Alaska post #4</li>
       <li>Alaska post #5</li>
       <li>Antarctica post #1</li>
       <li>Antarctica post #2</li>
       <li>Asia post #1</li>

    I prefer to handle this via a loop and not another plug-in. Any assistance is much appreciated.


    — Dennis

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Looping through / Grouping by Sub-Categories’ is closed to new replies.