WordPress.org

Ready to get started?Download WordPress

Forums

I can't for the life of me figure out how to get the nextpage tag to work (4 posts)

  1. Dan Rossiter
    Member
    Posted 2 years ago #

    I'm working with a child class of the 2011 theme and I can't get the <--nextpage--> tag to work. I've tried adding <?php wp_link_pages(); ?> into page.php where it ought to go (between <?php get_template_part( 'content', 'page' ); ?> and <?php comments_template( '', true ); ?>), but to no avail.

    Does anyone have any advice?

    PS: I'm not looking for a plugin fix. Unless I'm completely off, this should be a one- or two-line fix that shouldn't require that heavy lifting.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the code already exists in content-page.php of Twenty Eleven;

    <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>

    you will need to add the corresponding <!--nextpage--> tag into the content of a page to get it working.

    or install a plugin to get a 'nextpage' button for the visual editor: http://wordpress.org/extend/plugins/nextpage-buttons/

  3. rrhobbs
    Member
    Posted 1 year ago #

    you have to be careful if you cut n paste <!--nextpage--> it has to be exactly :
    less-than symbol(<), exclamation point(!), two short dashes (-- the one under the underline key on a U.S. keyboard),nextpage (text / no spaces), two more short dashes(--),greater-than symbol(>).

    I would suggest that you either type it out manually or if you cut n paste it from a web page you paste it in a plain text editor first to check if there are still two dashes. I think some themes (or maybe even WordPress itself? autop?) turns two dashes into a long dash?

    I just spent two hours going in circles figuring this out - doh...

    In your question you left out the exclamation point!

  4. Sri Shunyata
    Member
    Posted 1 year ago #

    The <!--nextpage--> tag was working fine until I updated to WordPress 3.5. Now when when I click on the numbered page link all it does is reload the main page.

    Really a novice with php and don't have a clue as to why this is happening.

    The site is http://buysubliminal.com and until I can work out what the problem is I'm not using the <!--nextpage--> tag

    However, it's a 2,500 word page and my bounce rate has gone way up now that its not being segmented.

    Please advise

    Thx

Topic Closed

This topic has been closed to new replies.

About this Topic