WordPress.org

Ready to get started?Download WordPress

Forums

Extracts in main page (8 posts)

  1. iMaks
    Member
    Posted 9 years ago #

    Hi! I´m new at wp. I installed it and downloaded a theme from kubrick, but I have a problem...

    I post in the blog, writing an extract and the content, but when I go into my web, the main page shows the entire content, not the extract.
    To do that I want I should go to the "Archives" link.

    How can I do it as well as I want?... The main page sameless the Archives page.

    Thanks!.. sorry, my english is pooooor.. I´m Spanish!...

  2. Kafkaesqui

    Posted 9 years ago #

    You'll need to modify your page template to get excerpts to display.

    To set it up so you are displaying excerpts on all pages EXCEPT single post pages, you need to insert a little PHP coding. Go into The Loop portion of your template, and modify the line:

    <?php the_content(); ?>

    to this:

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

    This will look to see if the reader is on a single post page. If they are, it displays the content of a post; if not, it displays the excerpt.

  3. chico
    Member
    Posted 9 years ago #

    Hello! Is there a simple way of adding a "read on..." link to the above? I would prefer this to using the <more> quicktag in the full post input box.

    Cheers

  4. moshu
    Member
    Posted 9 years ago #

    According to another post by Kafka, you can add this:
    <p><a href="<?php the_permalink() ?>" title="full post">Read more...</a></p>
    after the excerpt tag/call

  5. c0y0te
    Member
    Posted 9 years ago #

    Or you could just use the <!--more--> function that comes with WP1.5 by default :)

    Check your quicktags menu on the screen when you are creating the post and simply insert the <!--more--> tag where you want the break. WP1.5 will automatically then break the post at that point, and display a 'read more' link to the rest of it.

    c0y0te

  6. ringo999
    Member
    Posted 9 years ago #

    <!--more--> doesnt work for me :( all i get is an emtpy <a id="more-9"></a>. any idea what could be the reason?

  7. gour
    Member
    Posted 9 years ago #

    ringo999: have you resolved this issue?

    I have the same problem which appears only in the posts within certain category, while it works in "Monthly" archives :-()

    Any hint?

    Sincerely,
    Gour

    Edit:Ahhh...found it in #25717. It's a 'feature' for one post :-)

  8. mrbeerbelly
    Member
    Posted 7 years ago #

    In this case, the excerpt tag/call is:

    <?php the_excerpt(); ?>

    So it would look like this?

    <?php the_excerpt(); ?><p><a>" title="full post">Read more...</a></p>

    I DO get "Read more..." being displayed but it is down a line. Even if I remove the <p></p>...

    <?php the_excerpt(); ?>" title="full post">Read more...

    ...it prints a line down.

    How can I do it so it comes up in line at the end of the summary? Like:

    blah blah blah. Read more...

    THANKS! (This is driving me nuts!)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags