perfectlover
Member
Posted 3 years ago #
Hello,
I have this code and I want to exclude certain categories to be exluded.
<?php
query_posts("cat=".$singlecatid);
$i=0;
while (have_posts()) : the_post();
if($i % 2 == 0) $alt = 'odd';
else $alt = 'even';
$i++;
?>
Thanks
I'm confused--assuming $singlecatid has a value then the query_posts is only returning the posts from one category. Right?
Resources:
Exclude Posts From Some Category
But if I missed the question, maybe you are needing something like:
$cat = get_query_var('cat');
query_posts('cat=' . $cat);