• Hello,

    I’m trying to customize my archives page to show a list of all of the categories with posts and display the meta data of those posts under the categories.

    I am using the following code in my archives.php file and am getting the results I want but only for 1 category. How can I modify this?

    <div>
    <?php query_posts('showposts&cat=5'); ?>
    <h2>Articles In <?php single_cat_title(); ?></h2>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
    <li><span class="title"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></span> - <span class="meta"><?php the_modified_time('F j, Y'); ?> - <a href="<?php the_permalink() ?>#commenting" title="Jump to the comments"><?php comments_number('0 Comments','1 Comment','% Comments'); ?></a></span></li>
    <?php endwhile; ?>
    </ul>
    
    </div> <!-- END -->

    Thanks!

Viewing 1 replies (of 1 total)
  • Vaughan

    (@vaughan-van-dyk)

    Hi,

    Your code currently only gets posts from the category with an ID of 5. You need your code to loop through all the available categories and then run something similar to what you have there.

    I found this post that may be useful.

    Good luck.
    Vaughan

Viewing 1 replies (of 1 total)
  • The topic ‘display a list of all categories with posts and display the post title and meta’ is closed to new replies.