I’m displaying a simple category list on my site. It has each category plus the number of entries in that particular category out to the right in parenthesis. I just made 10 new entries and set them to be published on Monday, but even though they don’t technically show up until Monday, the category list is still recording them in the number out to the right of the category. I went to the edit tab and even “closed” these entries and was just going to manually publish them on Monday, but even setting them to closed didn’t do the trick. The number stayed the same and counted the entires even though they were not published yet.
Here is the code I’m using from the Wiki. Any way around this?
{exp:query sql="SELECT count(exp_category_posts.entry_id) AS post_count,
exp_category_posts.cat_id, exp_categories.cat_name
FROM exp_categories, exp_category_posts, exp_weblog_titles
WHERE exp_category_posts.cat_id = exp_categories.cat_id AND parent_id='0'
AND exp_weblog_titles.weblog_id = '2'
AND exp_weblog_titles.entry_id = exp_category_posts.entry_id
GROUP BY exp_categories.cat_order"}
<li><a href="http://{path=" title="View all posts filed under {cat_name}">{cat_name}</a> ({post_count})</li>
{/exp:query}