[resolved] NextPage tag only works with Default Permalinks (6 posts)

  1. chris630
    Posted 3 years ago #


    I'm trying to use the <!--nextpage--> tag on a page, not a post. The links show up fine at at the bottom of the next, but when I click on the page 2 link it throws a not found. My desired permalink structure is http://www.mysite.com/page-title/ which makes the page 2 link http://www.mysite.com/page-title/2/

    The only way I've been able to get this to work is by switching permalinks back to default at that point the links work and load the pages correctly.

    I've been stumped on this and looking through code for a while. I have another site that's a lot bigger that doesn't have this problem at all but I can't see any difference. Any help would be great thanks in advanced.

  2. keesiemeijer
    Posted 3 years ago #

    Do you have multiple loops on the page template or are you querying the main loop with query_posts?

    Can you post the full code of the page template here or in a pastebin - See the Forum Rules for posting code and using the pastebin.

  3. chris630
    Posted 3 years ago #

    Here's my loop-page.php code. It's formatted the same way as my other site where the <!--nextpage--> tag works fine which is what's so confusing. . .

    <div id="container">
    <div class="content">
    <?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    <div class="content-title">
    		<h1><?php the_title(); ?></h1>
    		<small><?php the_category(', '); ?> on <?php the_time('F j, Y'); ?> at <?php the_time(); ?>  by <?php the_author_posts_link() ?></small>
    </div><!--End Date-->
    		<?php the_content(); ?>
    		<?php wp_link_pages(); ?>
    <?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>
    <?php get_sidebar(); ?>
  4. keesiemeijer
    Posted 3 years ago #

    Does it work on other Pages with the same Page template?
    Do you have any custom posts type or custom taxonomies with the same title as your Page title?

  5. chris630
    Posted 3 years ago #

    Of course...that was the problem! The site has a plugin that was interfering with it I didn't even think about that. Thank you so much it's always the little things that drive you nuts.

  6. chris630
    Posted 3 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic