How to split pages in WordPress 2.5 with nextpage

May 1, 2008 – 8:50 pm
by Jake D

Problem: In WordPress 2.5.1, I was trying to make a multiple-page article using the <!–nextpage–> quicktag, but it wasn’t working.

Quick Answer: When you want a page break, switch to HTML/Code view and then type <!–nextpage–>.

Whole Story

As simple as this sounds, it took me 20 minutes to get this to work.  My problem was that I thought the usage was like other plugin quicktags, where you can just put it in anywhere.  But if you put in <!–nextpage–> while using the “Visual” or WYSIWYG editor, it will change your greater than and less than sign into the html entities.

The problem with having to switch to the HTML or code view is that I have to scroll down and find where my spot was in the article (if I am putting in page breaks after publishing).  It would be great if WordPress had a button on the writing toolbar, like the “More” tag, that would insert page breaks without having to switch to HTML or Code view, or worrying about whether you are in the right view or not.

This took me so much longer than it should have that this qualifies as a “computer problem that got in my way”.



Rate this article:


(No Ratings Yet)
Loading ... Loading ...

Advertisement:




  1. 13 Responses to “How to split pages in WordPress 2.5 with nextpage”

  2. On Jun 6, 2008 Shannon said:

    I still can’t get my page break to work, even when I input that code in html view. Any other suggestions? It’s driving me crazy!

  3. On Jun 6, 2008 Jake D said:

    What happens when you put it in? Do you just see

    < !-nextpage->

    when viewing the page?

    (WP keeps putting a space after the open bracket, I don’t mean to put that there.)

  4. On Aug 20, 2008 Stephan said:

    You have to write , i. e. it must look like an HTML comment with an opening arrow, an exclamation mark, TWO hyphens, the text, another TWO hyphens and a closing arrow.

  5. On Aug 20, 2008 Stephan said:

    Sorry, it actually commented it out. It must look like (without the spaces)

  6. On Aug 20, 2008 Stephan said:

    Dammit, how do I insert that? >!--nextpage--&lt

  7. On Aug 20, 2008 Stephan said:

    <!--nextpage-->
    That’s it. Please ignore/delete the previous two comments.

  8. On Oct 6, 2008 Jake D said:

    Stephan, thanks for the help!

  9. On Feb 15, 2009 Jan said:

    Hi,

    i came across your page searching for a solution to the same problem. By further research, I found out how to activate the pagebreak button in the visual editor. Thought you might be interested in this, too:

    In your theme’s function.php:

  10. On Feb 15, 2009 Jan said:

    [/code]

  11. On Feb 15, 2009 Jan said:

    <?php add_filter(‘mce_buttons’, ‘add_nextpage’);

    function add_nextpage($buttons) {
    if (!in_array(‘wp_page’, $buttons)) {
    if (!in_array(‘wp_more’, $buttons)) {
    $last = array_pop($buttons);
    $buttons[] = "wp_page";
    $buttons[] = $last;
    }else{
    $txt = implode(‘|’, $buttons);
    $txt = str_replace(‘wp_more|’,'wp_more|wp_page|’, $txt);
    $buttons = explode(‘|’, $txt);
    }
    }
    return $buttons;
    }

    ?>

  12. On Feb 15, 2009 Jan said:

    Finally! – Feel free to delete all those empty posts! ;)

  13. On Feb 15, 2009 Jake D said:

    Jan,

    Thanks for that! This should make it quick and easy!

  14. On Mar 7, 2009 Jon said:

    Very cool. Thanks for that! Just what I was looking for.
    I find it quite odd it was removed in the first place.

Post a Comment