WordPress.org

Support

Support » Themes and Templates » How to add "Read More" to Twenty Ten static page FOR DUMMIES.

How to add "Read More" to Twenty Ten static page FOR DUMMIES.

  • 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

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add "Read More" to Twenty Ten static page FOR DUMMIES.’ is closed to new replies.
Skip to toolbar