[wp-hackers] get total of posts NOT in selected categories
richzenmaster at gmail.com
Wed Oct 20 12:26:24 UTC 2010
Actually I don't need the list of posts. Just the post count.
On Wed, Oct 20, 2010 at 5:12 AM, Andrew Nacin <wp at andrewnacin.com> wrote:
> On Wed, Oct 20, 2010 at 7:53 AM, Rich ZenMaster <richzenmaster at gmail.com
> > Hi,
> > I need to get the total number of posts that are not in selected
> > categories.
> > I have category IDs of the categories that I want to exclude from count
> > the variable $folio_cat_ids)
> Avoid direct queries where possible, unless you're caching them.
> To retrieve a list of posts and avoid a certain category, check out
> WP_Query, http://codex.wordpress.org/Function_Reference/WP_Query, or
> Then check out the category__not_in query var.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers