[wp-hackers] Exclude Categories From The Loop
peter.westwood at ftwr.co.uk
Fri Oct 5 14:10:34 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
> Unless something has changed shouldn't the code referenced in the
> codex loop page work?
> <?php if (in_category('3')) continue; ?>
> Obviously this isn't optimized from a SQL perspective (you're still
> pull all posts from the DB, just not displaying some of them), but it
> does what was asked for.
The biggest issue with this AFAIK is that it means that you may end up
with less posts on the page than expected.
And if the last "n" posts are all in the category you get no posts
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the wp-hackers