• Resolved columboman

    (@columboman)


    Hi all,

    My index.php is currently showing the first published post as the content and the rest are excerpts. That’s acheived using the below code. Trouble is the “Read more” link is shown at the bottom of the first full content post as well as the excerpts. Is there a way to remove that link from there and just have it show on the excerpt posts?

    Cheers in advance. C.

    <div class="entry">
    <?php if ($wp_query->current_post == 0) {
    the_content();
    } else {
    the_excerpt();
    } ?>
    <span class="read_more"><a>">Read more...</a></span>
    </div>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Try:

    <div class="entry">
    <?php if ($wp_query->current_post == 0) {
    the_content();
    } else {
    the_excerpt();?>
    <span class="read_more"><a>">Read more...</a></span>
    <?php } ?>
    </div>
    Thread Starter columboman

    (@columboman)

    Cheers for the reply…

    Close but no cigar! That code knocks off the link under the full content post but changes the visual apperance of the links under the excerpts to exactly:

    “>Read more…

    (it also disables the link)

    Thread Starter columboman

    (@columboman)

    Cracked it with:

    <div class="entry">
    <?php if ($wp_query->current_post == 0) {
    the_content();
    } else {
    the_excerpt();?>
    <span class="read_more"><a href="<?php the_permalink(); ?>">Read More...</a></span>
    <?php } ?>
    </div>

    Cheers for the help esmi.

    C.

    For a noob – how can i eliminate the read more and just to to full article.. I couldnt understand above post and dont wanna screw up my site.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove “Read More” link from bottom of just the first post?’ is closed to new replies.