I'm building a custom homepage that has that structure:
Cat 1
Post 1 | Post 2 | Post 3
Cat 1
Post 1 | Post 2 | Post 3
etc...
I know how to get all top non-empty categories, loop through them and inside each fetch latest 3 posts. However, that would imply doing as many exdtra DB queries as categories I have, so I think that would not be optimal.
I think I might be able to hack a custom SQL query that fetches that data only, but I want to be able to use recular post code such as <?php the_permalink(); ?>
.
Is there an optimal solution to this?