[resolved] Add a Read More link (4 posts)

  1. Nith
    Posted 6 years ago #


    Currently I have code that pulls the latest blog post into my home page. The main content is pulled using the following code:

    <?php the_content(); ?>

    However, currently all of the post is displayed and I wish to limit the text that is displayed and them have a "Read More" link. I know I can achieve this by using the the_excerpt function but I would prefer it to be done automatically.

    Anyone know?

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    You can:

    1. Opt for the simple automatic method using <?php the_excerpt();?>

    2. Use the <--more--> tag in your posts to create your summary manually.

    3. Use <?php the_excerpt();?> with a custom excerpt plugin.

    4. Use <?php the_excerpt();?> and add a hand-written excerpt to each post.

  3. Michael
    Forum Moderator
    Posted 6 years ago #

    that is the automatic way -
    using the_excerpt() instead the_content() .

    the manual way would be:
    either to write a manual excerpt below the post edit window;
    or to use the 'more' button while writing the post
    (and changing the_content('read more');).

  4. Nith
    Posted 6 years ago #

    Thanks all.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.