Forums

Using excerpts everywhere but the single post page (4 posts)

  1. mkyd1963
    Member
    Posted 2 years ago #

    Hi,

    Currently my theme has this in the main index template.php:

    <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>

    which means full posts everywhere, except in the SERPS, correct?

    Now, if I were to add this:

    <?php if (is_search()) { ?>
    <?php the_excerpt() ?>
    <?php } elseif (is_category()) { ?>
    <?php the_excerpt() ?>
    <?php } elseif (is_year()) { ?>
    <?php the_excerpt() ?>
    <?php } elseif (is_month()) { ?>
    <?php the_excerpt() ?>
    <?php } elseif (is_day()) { ?>
    <?php the_excerpt() ?>
    <?php } else { ?>
    <?php the_content('Read the rest of this entry ยป'); } ?>

    this would mean excerpts everywhere, but not on single posts, am I right?

    In other words (and just so I understand correctly), if a reader were to go to my homepage, they would see excerpts of my posts and if they clicked on the permalink, they would be taken to the full single post. Now, if I wanted a read more link at the end of the excerpt, that's another line of code that should be added to the above block of PHP, correct? I'm a newbie to PHP, but I think I did good. I just want to run it by you guys to confirm I got it right.

    Thanks in advance,

    Mike
    http://mikesblogmarketingtips.michaeldroberson.com

  2. mkyd1963
    Member
    Posted 2 years ago #

    OK.

    That didn't work.

    Unless I'm missing some code.

  3. mkyd1963
    Member
    Posted 2 years ago #

    Nevermind.

    I just hosed up my theme.

  4. mkyd1963
    Member
    Posted 2 years ago #

    Not sure how I did this, but only got the post titles showing now

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags