Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Next Page Function is Not working For Multiple Pages in Posts WordPress


*This is a repost. My other listing for whatever reason won't show up on this site. I haven't got a response from the webmasters yet as to why. because I am in need of answer immediately, I was forced to repost and then I will be asking for refund on other listing. Only respond to this post please*

I think that this is a simple question with a simple answer that I may be overlooking. I'm just being as descriptive as I possibly can but don't believe that the problem is as severe as this post might suggest based on its length. :-)

I'm trying to paginate my posts but the <!--nextpage--> function isn't working even though I have this in my theme's template.

<div class='pagenavi pagenavi-top'> <?php wp_link_pages('before=<div id="page-links">&after=</div>'); ?> </div>

And you can see a test post that I had recently done where you can see the numbers for the pagination but when you click on the number, the page just refreshes instead of going to the next page.

Example post here:

You will see the page numbers below the article. So by the page numbers appearing article, it would seem that everything was done correctly on my end.

And one last thing, how would I add the "previous page" and "next page" to the numbers as in this example below?

I tried reading through the codex and couldn't figure it out.


And here's the enitre code in my single.php file just in case you needed it.

<?php get_header(); ?>

<div id="topLeaderboard">

<?php advman_ad('Leader'); ?>

<?php include('featured_posts_slideshow.php') ?> <!--Adds Featured Posts -->

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php if(in_category ('from-the-bottom-up-fernando-quijano')) {?>

<div class="col-banner">

<img src="">

<?php }?>

<?php if(in_category ('the-most-hated-list-bryan-stewart')) {?>

<div class="col-banner">

<img src="">

<?php }?>

<?php if(in_category ('the-speaker-box')) {?>

<div class="col-banner">

<img src="">

<?php }?>

<div id="title"><?php breadcrumbs_plus( $args ); ?>
<h1><?php the_title(); ?></h1>

<div class="post">

<div class="post" id="post-<?php the_ID(); ?>">

<small><?php echo get_avatar( get_the_author_id() , 35 ); ?> By <?php the_author_posts_link(); ?> on <?php the_time('F j, Y') ?> at <?php the_time() ?> | <?php comments_popup_link('No comments yet', '1 comment so far',
'% comments so far (is that a lot?)', 'comments-link', 'Comments are
off for this post'); ?> <?php edit_post_link( __('Edit'), ' | ', ''); ?>

</small><br />

<div style="clear:both;"></div>

<div id="socialicons">

<div style="float:left;padding-right:5px;"><?php if (function_exists('fbshare_manual')) echo fbshare_manual(); ?></div>

<div style="float:left;padding-right:5px;"><a href="" class="twitter-share-button" data-count="horizontal" data-via="theurbantwist">Tweet</a><script type="text/javascript" src=""></script></div>

<div style="float:left;padding-right:5px;margin-left:-15px;"><script src=""></script></div>

<script type="text/javascript">
(function() {
var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
s.type = 'text/javascript';
s.async = true;
s.src = '';
s1.parentNode.insertBefore(s, s1);
<!-- Compact Button -->
<a class="DiggThisButton DiggCompact"></a>


<div style="clear:both;"></div>

<!-- surphace start -->

<?php the_content('<p>Read the rest of this entry &raquo;</p>'); ?>

<div class='pagenavi pagenavi-top'> <?php wp_link_pages('before=<div id="page-links">&after=</div>'); ?> </div>

<!-- surphace end -->

<div id="social-headlines">
<h7>Get The Urban Twist on
<a href="" target="_blank">Facebook</a> and
<a href="" target="_blank">Twitter</a>!</h7>
<br><br><h7>Don't Forget to Sign Up For
Our Brand New <a href="" target="_blank">Newsletter</a>!</h7>

<div id="like-story">
<h1>Do You Like This Story?</h1>
<iframe src="<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; margin-top:-10px; width:450px; height:30px;"></iframe>

<div id="outbrain"></div>

<div id="ad-story">
<?php advman_ad('Sidebar Top'); ?>

<div style="clear:both;"></div>

<small><?php the_tags( __( '<span class="tag-links">Tags: ', 'wpbx' ), ", ", "</span>\n" ) ?></small>

<div class="clear"></div>


<div class="clear"></div>

<?php comments_template(); ?>

<?php endwhile; else: ?>

<p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Answers (3)


Peter Michael answers:

Does it work when you disable the WP Pagenavi plugin?

Brennen Jones comments:

Unfortunately not. I deactivated all plugins that I have and it still doesn't work. I even deleted my .htaccess file and reinstalled it. Still doesn't work.


Dan | gteh answers:

I've seen this happen on some servers where there was a problem with permalinks/.htaccess .

Just out of curiosity, can you temporarily turn off the friendly permalinks and re-enable the default way of index.php?p=12345

then see if it works?

Brennen Jones comments:

I just tried that. It still didn't work.


Marvin Shaker answers:

Update Your Permalink.

Make Sure your .htaccess is writable.

The Problem Might Be Your Template Try Changing it

Try this <?php wp_link_pages( $args ); ?>

Brennen Jones comments:

Thanks my man, but I've already tried that. Just doesn't work. Peter above gave me some pointers and it looks like my host may be the culprit.