• I’m setting up the category.php file to post excerpts of a chosen category. The title of each excerpt and the Featured Image of each excerpt is the same, which isn’t right. But the body content is different. When users click on the link to Read More, it doesn’t go to its respective article. Not sure what’s going on.

    Anyone?

    I have the following code:

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <?php /*?> <h2>Archive for the ‘<?php single_cat_title(); ?>’ Category:</h2><?php */?>
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <h2>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2>Archive for <?php the_time(‘F jS, Y’); ?>:</h2>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2>Archive for <?php the_time(‘F, Y’); ?>:</h2>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2>Archive for <?php the_time(‘Y’); ?>:</h2>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2>Author Archive</h2>
    <?php /* If this is a paged archive */ } elseif (isset($_GET[‘paged’]) && !empty($_GET[‘paged’])) { ?>
    <h2>Blog Archives</h2>
    <?php } ?>

    <div class=”post”>
    <h3>“><?php the_title(); ?></h3>

    <div class=”entry”>
    <?php /*?><?php the_content(); ?><?php */?>
    <?php
    if ( has_post_thumbnail() ) {
    the_post_thumbnail();
    }
    ?>
    <?php the_excerpt(); ?>
    <?php echo ‘Read More‘; ?>
    <?php /*?> <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’, ‘ | ‘, ”); ?>
    </p><?php */?>

    </div>

    </div>

    <?php endwhile; ?>

    <div class=”navigation”>
    <?php posts_nav_link(); ?>
    </div>

    <?php endif; ?>

    </div></div>

  • The topic ‘Excerpts all the same heading? Why?’ is closed to new replies.