WordPress.org

Ready to get started?Download WordPress

Forums

A Readable Comment Page (1 post)

  1. ajaskey
    Member
    Posted 5 years ago #

    Readers of my blog have requested a page of past comments for easier access. I created a script similar to a page I use to dump the_excerpt of the last 30 posts. This works.

    <?php $archive_query = new WP_Query('showposts=30');
    while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
    <h2 class="archives">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
    <h4 class="meta"><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></h4>
    <div class="entry">
    <?php the_excerpt() ?>
    </div>
    <?php endwhile; ?>

    I modified this but can't figure out how to print the comments.

    <?php $archive_query = new WP_Query('showposts=30');
    while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
    <?php wp_list_comments(); // ?????? ?>
    <?php endwhile; ?>

    I've tried $archive_query->wp_list_comments(); but that is wrong.
    Any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags