WordPress.org

Ready to get started?Download WordPress

Forums

How to add "Read More" to Twenty Ten static page FOR DUMMIES. (3 posts)

  1. MET4LDOG
    Member
    Posted 2 years ago #

    Hi all.
    I am using a Twenty Ten Child Theme. I want to add the "Read More" feature to static pages. I have found the solution but do not have the skill to carry out what seems to me very complicated. Could someone please explain to me in the simplest way possible e.g. to a DUMMY : )) how to do the following as per the bottom of this page (http://codex.wordpress.org/Customizing_the_Read_More):

    How to use Read More in Pages

    Please remember that the "Read More" tag is used only on the Home page which shows the latest posts. It does not work in "Pages". If you want to turn it on in Pages too for showing a set of partial posts, use the following code inside the loop for the dynamic content:

    <?php
    global $more;
    $more = 0;
    ?>
    //The code must be inserted ahead of the call the_content, but AFTER the_post()

    <?php the_content('Continue Reading'); ?>

    When to set $more

    It's important that if you're going to over-ride the default $more global variable you do it inside The Loop, but after your setup the post. If you're working with the standard Loop and using the_post(), make sure you set $more after the_post (but before the_content().

    See More tag ignored on static front page forum topic.
    More about $more

    If you set the $more variable to -1, the More tag will not be displayed. This can be useful in a "mullet loop". Like this:

    <?php global $more; $more = -1; //declare and set $more before The Loop ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); //begin The Loop ?>
    <?php
    if ($more == -1) { //do not use the more tag on the first one.
    the_content();
    $more = 0; //prevent this from happening again. use the more tag from now on.
    }
    else { //use the more tag
    the_content(__('Read more...'));
    }
    ?>
    <?php endwhile; //end of The Loop ?>

    Thanking you in advance.

    Kind regards

    Etienne

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    you can't use 'read-more' on static pages.

    - try to work with <!--nextpage--> instead;

    http://codex.wordpress.org/Styling_Page-Links

    you can use a plugin to add the 'nextpage' button to the editor toolbar: http://wordpress.org/extend/plugins/nextpage-buttons/

  3. MET4LDOG
    Member
    Posted 2 years ago #

    Thank you.

    I will try and work with that.

Topic Closed

This topic has been closed to new replies.

About this Topic