Post per Page Counter Problem (Excluded Categories)
-
I am excluding posts from some specific categories on frontpage by using the following code in The Loop (continue to the next post if $flag is false):
foreach ((get_the_category()) as $category) if($category->cat_ID == 3 || $category->cat_ID == 4) { $flag = false; break; }This is successful as a solution to exclude posts from cat3 and cat4. However post count per page is incremented while going through those excluded ones. That’s why number of posts shown on the page is not equal to what is set in the Admin Panel.
Is there a way that I could decrement the post count by one for those I skip? or any other way to retain the same amount of posts per page?
Thanks.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Post per Page Counter Problem (Excluded Categories)’ is closed to new replies.