[wp-hackers] Regarding paging in WP 1.5
Jonathan Leighton
turnip at turnipspatch.com
Sat Mar 12 16:17:29 GMT 2005
Hi everyone,
Over the last couple of days I have become aware of the new "paging"
functionality in WordPress 1.5. Before 1.5 the number of posts specified
under Reading Options applied only for the index page; the archive and
category pages showed every single post that applied. However, in 1.5
the archive and category pages show that number of posts split into
"pages". This was obviously a conscious design decision, and whether or
not I agree with it (which I don't) is pretty irrelevant -- I'm more
worried about the lack of documentation about this change (the only way
I knew about it was looking at the default theme) and the difficulty I
encountered in turning it off.
First and foremost, this really *should* have been announced. By virtue
of the fact that this feature wasn't available in 1.2, everyone who has
ported their 1.2 design to a 1.5 theme (unless they studied the default
theme code) will have "broken" archives that cannot fully be accessed.
This is a change that affects fundamental behaviour, and people need to
know about it. To prove my point, there has been a fair amount of
confusion surrounding this behaviour:
* http://wordpress.org/support/topic.php?id=23333
* http://wordpress.org/support/topic.php?id=12120 (read the first
sentence out loud)
* http://wordpress.org/support/topic.php?id=21819
*
http://comox.textdrive.com/pipermail/hackers/2005-January/thread.html#3551
In this announcement, there should have been instructions about how
users could, if they wanted to, turn this feature off and stick with the
1.2 behaviour -- after all, not everyone has the time to mess around
with their templates with every new release. But perhaps such an
announcement was never made because it is *very* difficult to turn it off.
The ways I know of are:
1) query_posts('nopaging=true'); before the loop or "nopaging=true" in
the querystring (if your theme doesn't have an archive.php then you'd
need to use "if (is_archive()) query_posts('nopaging=true');" to make
sure it doesn't show them all for the index page). This method does,
indeed, turn it off, but in my testing it has shown *EVERY SINGLE*
published post in the database, not just the ones for that
month/year/category/whatever (which of course raises the question as to
whether that much power should be put in a querystring).
2) query_posts('posts_per_page=-1'); before the loop or
"posts_per_page=-1" in the querystring. This option implies
nopaging=true anyway, so is practically the same as above.
3) "$posts_per_archive_page = -1;" before the call to
wp-blog-header.php. This has been the only satisfactory solution I have
found (and I've spent a good few hours staring gormlessly at the code).
However, this is really not good enough because WP is trying to appeal
to non-technical users -- this should be an admin option, NOT a code
tweak. Also, it has to be before the blog header include, so cannot be
used specifically in themes but only right across the blog.
If anyone has any more insight into this I'd love to hear it, but more
importantly, I think this is a MUST for version 1.5.1, and an
announcement should be made about it so that people are aware of the
problem.
Regards,
Jon
--
Jonathan Leighton aka. Turnip
http://turnipspatch.com/ | http://digital-proof.org/
More information about the wp-hackers
mailing list