Skip to main content
6 events
when toggle format what by license comment
Aug 12, 2010 at 15:50 comment added john010117 Did you actually try using my code and seeing if it works? I'm not too familiar with the pre_get_posts hook, so I can't be much help there. Also, try to modify the $paged variable directly (ex: $paged = $paged - 1)) if you're worried about next_posts_link().
Aug 12, 2010 at 15:25 comment added Jan Fabry Argh, if I try to edit the paged parameter in the pre_get_posts hook, redirect_canonical kicks in and wants to replace the url with the new paged parameter. I can disable redirects in this case, but next_posts_link uses a global $paged variable that gets set to the new value, but I don't know by which code, so it's incorrect.
Aug 12, 2010 at 14:52 comment added john010117 AFAIK, it shouldn't affect next_posts_link. The only way to find out is to actually try it, of course.
Aug 12, 2010 at 14:44 comment added Jan Fabry Changing the paged parameter won't break anything else, like the next_posts_link?. Maybe it's better to modify the query in the pre_get_posts hook, so I don't create a new query? And yes, this is WP 3.
Aug 12, 2010 at 14:41 history edited john010117 CC BY-SA 2.5
Added `$post->post_type == 'post'` to the first `if` declaration
Aug 12, 2010 at 14:26 history answered john010117 CC BY-SA 2.5