Expand/Collapse articles in category view? (2 posts)

  1. Loganaew
    Posted 6 years ago #


    I was wondering if there is a mod or hack available that when you are viewing a category, it lists the entries in that category but only shows the entry title, date, and if present, the excerpt? And in order to see the full entry, a user must click "Expand" on that entry.

    We're a newspaper site, so this would make browsing the latest articles per-category much easier! Instead of scrolling through lots, and lots of text.

    Thanks a lot!

  2. tugbucket
    Posted 6 years ago #

    <?php while (have_posts()) : the_post(); ?>
    <div class="post search">
    <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
    <p class="date"><span class="month"><?php the_time('M') ?></span><?php the_time('jS') ?><br /><?php the_time('Y') ?><br />••</p><?php the_excerpt(); ?>
    <p class="metastuff"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?></p>
    <?php endwhile; ?>

    That's my loop for archive.php. It shows the title, date, excerpt and tags of each post in the category. Granted there are some classes used specifically for my site but i think it's what you want.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.