Loop inside sub categories loop
-
I am using the following code to get the child categories of the category 7:
<?php $descendants = get_categories(array('child_of' => 7)); ?> <?php foreach ($descendants as $child) { ?> //do stuff <?php } ?>
What I need is for each child category, to then query the posts of that category and display the title of the three newest posts in that child category – i.e. all this would happen in the ‘do stuff’ part.
Anybody any ideas?
Thanks in anticipation!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Loop inside sub categories loop’ is closed to new replies.