nextpage tag
-
I am having a problem with the nextpage tag in WP 3.0, and it appears to be a rewrite bug.
Post url:
/category/year/month/post-slug/When I click the following pagination link:
/category/year/month/post-slug/2/I am redirected back to the original post url.
Manually loading the following url works fine:
/category/year/month/post-slug/?page=2I’m pretty sure this was not an issue in WP 3 RC1. I can’t remember if I ever tested post pagination in RC2 or RC3.
-
I still have not found any discussion on this bug.
After a bit of experimentation, I have discovered that the nextpage rewriting bug is only present when %category% is included in the permalink structure.
nextpage works with this permalink structure:
/%year%/%monthnum%/%postname%/nextpage does not work with this permalink structure:
/%category%/%year%/%monthnum%/%postname%/After even more experimentation, it seems my last post is not accurate.
The nextpage tag works fine with the following permalink structure:
/%category%/%year%/%monthnum%/%postname%/…unless the post belongs to a child category.
So, a URL of structure:
/parent_category/child_category/year/monthnum/postname/will not paginate.
Hi,
Check with this plugin:
http://ww.wp.xz.cn/extend/plugins/wordpress-navigation-list-plugin-navt/
Thanks,
Shane G.
Just found out that if the post is in a sub-category and not the main category, it doesn’t work as it should.
So let’s say you have two categories :
Category A
— Category BAnd you’ve posted your post in Category A only, it works.
If you’ve posted it in Category B only, and it links like this – /category-b/post-name/2 then it works.
However if you have posted it in Category B only and the link is like this – /category-a/category-b/post-name/2 then it stops working.
Have you re-tried this using the default permalink settings or one of the common settings?
With default permalink settings it all works fine.
For my end it only doesn’t work with custom permalinks (/%category%/%postname%/) – well, I’m not really trying with any other combination š
I’m afraid you may have hit one of the potential permalink issues that are mentioned in the documentation. A custom structure that begins with a numeric might sidestep the issue.
Ouch, noted then! Thanks for clarifying, esmi!
Will just have to wait it out until this is fixed. š
Oh my god. I got the same problem on WP 3.0
My site runs like this: /category-a/category-b/post-name/
So, the pages does not work. All is broken, everything. What should I do to fix it? I mean, all the paged texts (A LOT!)
Please, someone?
I already tried the tip on documentation using a post id on the front, same thing.
Thanks.
Same problem, like noted on http://ww.wp.xz.cn/support/topic/415454
I use Pagebar2 for multipaging, so my very poor workaround was to edit the function create_link($page) in class-multipagebar.php not to use URLs like /cat/subcat/page/2, but /cat/subcat/page/?page=2
$link = trailingslashit(get_permalink()) . ‘?page=’ . $page;
instead of
if (” == get_option(‘permalink_structure’) || in_array($post->post_status, array(‘draft’, ‘pending’)))
$link = get_permalink() . ‘&page=’ . $page;
else
$link = trailingslashit(get_permalink()) . user_trailingslashit($page, ‘single_paged’);But that’s not what I really want… looking forward for a bugfix!
Did the same fozloki, thanks for the tip.
I edited the plugin I use, Multi-Page toolkit.
Using the same technique.
Now, waiting for a official bugfix.
@ fozloki
We have the same Problem here one example:
But now we switch the Code in pagebar2 also to: $link = trailingslashit(get_permalink()) . ‘?page=’ . $page;
Thankx for this information. š
I hope that the Problem will fix soon.
I have the same problem, when clicking on a page link it redirects to the same page… what I did while they solve this bug, remove the nextpage from content before displaying.
In the single.php:
<?php
$content = $post->post_content;
$content = str_replace('<!--nextpage-->','-', $content);
$content = str_replace("\n<!--nextpage-->\n", ' ', $content);
$content = str_replace("\n<!--nextpage-->", ' ', $content);
$content = str_replace("<!--nextpage-->\n", ' ', $content);
$content = apply_filters('the_content', $content);
echo $content;
?>
The topic ‘nextpage tag’ is closed to new replies.