See a page of posts for some ideas.
Thanks for your responses. I took a look at both but I’m unfortunately still struggling to implementation. Here’s where I am… I am able to generate a page of posts that displays the name of the subcategories but and below each it shows a posts but the posts it shows do not correspond to the category name. I thought by placing my query_posts() in my foreach(): loop it would inherit the particular category but no such luck. Here’s the first attempt I made:
<?php $cats = get_categories('orderby=id&order=DESC&child_of=5');
foreach ($cats as $cat) :
echo '<h1>' . $cat->name . '</h1>';
query_posts( 'orderby=date&order=ASC' );
if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; wp_reset_query(); ?>
<?php endforeach; ?>
I then thought I needed to drop $cat into the query_posts() args but I got an error doing that. Am I on the right track? What am I doing wrong? Thanks again for you help.
Ariel
I then thought I needed to drop $cat into the query_posts() args but I got an error doing that. Am I on the right track?
yes – the error came possibly from some syntax violation;
instead:
query_posts( 'orderby=date&order=ASC' );
try:
query_posts( 'orderby=date&order=ASC&cat='.$cat->term_id );
you also might need to add a ‘posts_per_page’ parameter:
query_posts( 'posts_per_page=10&orderby=date&order=ASC&cat='.$cat->term_id );
Aha! I think that solved it. Thanks for all the help!