Forums

[resolved] Display full post for archive? (6 posts)

  1. jf80
    Member
    Posted 8 months ago #

    When a user clicks on a tag or category on my blog I would like the full posts to be displayed rather than just the title.

    I am using the blocks theme on this page http://www.neoease.com/themes/.

    Is this something I could change myself?

    Thanks.

  2. peterebutler
    Member
    Posted 8 months ago #

    You can change that fairly easily. In the theme folder, open archive.php, and find this block:

    <?php while (have_posts()) : the_post(); ?>
    <li class="archive-post">
    <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <div class="small"><? printf( __('%1$s at %2$s', 'blocks'), get_the_time(__('l, F jS, Y', 'blocks')), get_the_time(__('H:i', 'blocks')) ); ?> | <?php comments_popup_link(__('No comments', 'blocks'), __('1 comment', 'blocks'), __('% comments', 'blocks')); ?><?php edit_post_link(__('Edit', 'blocks'), ' | ', ''); ?></div>
    <div class="small"><?php _e('Categories: ', 'blocks'); the_category(', ') ?></div>
    <div class="small"><?php _e('Tags: ', 'blocks'); the_tags('', ', ', ''); ?></div>
    </li>
    <?php endwhile; ?>

    Then add <?php the_content(); ?> in after the H3 block, like this:

    <?php while (have_posts()) : the_post(); ?>
    <li class="archive-post">
    <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <p><?php the_content(); ?></p>
    <div class="small"><? printf( __('%1$s at %2$s', 'blocks'), get_the_time(__('l, F jS, Y', 'blocks')), get_the_time(__('H:i', 'blocks')) ); ?> | <?php comments_popup_link(__('No comments', 'blocks'), __('1 comment', 'blocks'), __('% comments', 'blocks')); ?><?php edit_post_link(__('Edit', 'blocks'), ' | ', ''); ?></div>
    <div class="small"><?php _e('Categories: ', 'blocks'); the_category(', ') ?></div>
    <div class="small"><?php _e('Tags: ', 'blocks'); the_tags('', ', ', ''); ?></div>
    </li>
    <?php endwhile; ?>

    That should do the trick, although you may have to do some extra styling with css to get it to look the way you want it to.

    Edit: The code I pasted was a mess. This should format a little better.

  3. jf80
    Member
    Posted 8 months ago #

    Thanks, that is perfect.

  4. silveraden
    Member
    Posted 1 month ago #

    Can we do this on category? I want to display full posts in category pages.. tahnks

  5. MichaelH
    moderator
    Posted 1 month ago #

    With the help of the Template Hierarchy article, determine what Template is displaying your categories, then use the_content() accordingly.

    Also see the first four questions here:
    FAQ_Layout_and_Design#Text_and_Content_Display

    silveraden - note I deleted the duplicate topic you started.

  6. silveraden
    Member
    Posted 1 month ago #

    I missed this one.. thanks a lot..

Reply

You must log in to post.

About this Topic

Tags