[wp-hackers] Pagination wp_query variable bug?

Nathaniel Taintor goldenapplesdesign at gmail.com
Tue Aug 21 18:11:36 UTC 2012


I actually came across the same problem in a plugin I built recently. Took
me a while to figure it out, but I think what you're seeing is expected
behavior.

The paging setup for Pages ( the <!--nextpage--> quicktag, and the
endpoints /page/2, /page/3, etc to jump to the nth of those quicktags) is a
completely different thing from archive paging, so it makes sense to use a
different query variable.

In my plugin I got around that problem by adding a couple custom rewrite
rules that force that $paged query variable to be set, even if /page/2 is
part of an endpoint for a Page. Not a very elegant solution, but neither is
the whole concept of using a Page to hold an archive - that was just a
fallback I left in there for users who didn't want to bother setting up the
proper archive templates.

Nathaniel Taintor, Designer/Developer
*Golden Apples Design*
http://goldenapplesdesign.com

@GoldenApples | 717.434.3226
goldenapplesdesign at gmail.com



On Tue, Aug 21, 2012 at 9:53 AM, Otto <otto at ottodestruct.com> wrote:

> On Tue, Aug 21, 2012 at 11:02 AM, Matt Slocum <mattslocum at sharefaith.com>
> wrote:
> > I have a plugin that puts blog posts onto a page. (This means I use a
> > custom new WP_Query) It has been working great until recently a user put
> > attempted to set the page with blog posts as his static front page.
>
> I don't know the specifics of the problem, however the general
> approach here strikes me as a bit nutty. :)
>
> Basically, you're putting Posts onto a Page and then making that Page
> into the Front. This is a bit of a backwards thinking sort of
> approach, considering that the default behavior is to put the latest
> Posts onto the Front by default. Seems like you'd be better served by
> customizing the main query instead and not using a Page on Front at
> all.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list