• Resolved Ude

    (@ude)


    Hi there,

    I’m working on a front page with its own template. It uses the loop two times, first only to display the content of that page, then display the three most recent posts.

    The problem is that it doesn’t show the comments-field for some reason. I’m hoping if someone could quickly spot what is wrong with my code:

    First comes the loop for the page’s content:

    <?php if(have_posts()): ?>
    <?php while(have_posts()): the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>

    Then a new loop the the recent post:

    <?php $my_query = "showposts=3"; $my_query = new WP_Query($my_query); ?>
    <?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
    <div class="post front" id="post-<?php the_ID(); ?>">
    <h2>
    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    <?php the_title(); ?></a>
    </h2>
    <p class="date">Written by <?php the_author(); ?> on
    <?php the_time('l, F jS, Y'); ?>
    
    <div class="entry">
    <?php the_excerpt(); ?>
    <a class="more" href="<?php the_permalink(); ?>">Read more &raquo;</a>
    <p class="postmetadata">
    <?php _e('Filed under:'); ?>
    <?php the_category(', ') ?>
    <?php _e('by'); ?> <?php  the_author(); ?>
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    <?php edit_post_link('Edit', ' | ', ''); ?>

    So everything else works as it should, but it doesn’t display the comments-field.

    Please help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Ude

    (@ude)

    Okay, I just read that comments_popup_link apparently works only in index and archive-pages. Terribly sorry I didn’t check on that sooner before posting. I wonder what I should use instead.

    Thread Starter Ude

    (@ude)

    Okay people, nothing to see here, I found the solution. Gah, why wasn’t I able to find this before I posted. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Comment field under excerpt not showing up’ is closed to new replies.