Forums

[resolved] Need to change cat archive setting from excerpt to full post (7 posts)

  1. birdfan
    Member
    Posted 3 years ago #

    Hi, My theme only shows excerpts when searching through categories. I think it is this entry in archive.php:

    <!--optional excerpt or automatic excerpt of the post-->
    <?php the_excerpt(); ?>

    Am I right? How do I change this so it will show full posts when in the categories?

    Thanks

  2. t31os
    Member
    Posted 3 years ago #

    Hard to say without seeing more of the code from that file.....

    The lines you've posted only tell me the excerpt is being called, but not any clue as to what event it is called in...

  3. birdfan
    Member
    Posted 3 years ago #

    Here is the entire context of the section:

    <!--loop article begin-->
    <?php while (have_posts()) : the_post(); ?>
    <!--post title as a link-->
    <h3 id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>

    <!--Post Meta-->
    <div class="post-meta-top">
    <div class="auth"><span>Posted by <?php the_author_posts_link(); ?></span></div>
    <div class="date"><span><?php the_time('F j, Y'); ?></span></div>
    <div class="clearboth"></div>
    </div>

    <!--optional excerpt or automatic excerpt of the post-->
    <?php the_excerpt(); ?>

    <!--Post Meta-->
    <div class="post-meta-bottom">
    <!--<?php if (function_exists('the_tags')) { ?>Tags: <?php the_tags('', ', ', ''); ?>
    <?php } ?>-->
    <div class="cat"><span class="cats"><?php the_category(', ') ?></span><span class="tags"><?php the_tags('', ', ', ''); ?></span></div>
    <div class="comm"><span><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></div>
    <div class="clearboth"></div>
    </div>

    <!--one post end-->
    <?php endwhile; ?>

    I just want the full post to show up when going through category pages instead of the excerpt I'm currently getting.

    Thanks

  4. t31os
    Member
    Posted 3 years ago #

    Doesn't look like it does any specific category checking.

    Do you have a category.php file with your theme?

    If not you can always adjust the above...

    <?php the_excerpt(); ?>

    Becomes something like...

    <?php if(is_category()) { the_content(); } else { the_excerpt(); } ?>

  5. birdfan
    Member
    Posted 3 years ago #

    That string worked. Thanks a lot!!

  6. t31os
    Member
    Posted 3 years ago #

    You're welcome. :)

  7. ilkrgz
    Member
    Posted 2 years ago #

    worked for me too thank you :)

Topic Closed

This topic has been closed to new replies.

About this Topic