If using in_category() to exclude categories, it’s working as it should.
At issue here is how in_category() is able to test against a post, which is only after it resides in the present post query or object. It has no ability to retrieve yet another post when one is passed over. So if a page displays ten posts but three fall within an excluded category, only seven are displayed. It’s a basic math problem: 10 – 3 = 7.
A way around this is to exclude the category from the initial post query itself. For that, see the info on query_posts():
http://codex.ww.wp.xz.cn/Template_Tags/query_posts
Thread Starter
akela
(@akela)
I did so – used query_posts() soon after realized that maybe i want too much. But with this query i can not use NEXT PREVOUS links either – pressing on them returns me the same 1st page. At last i decided to drop the idea and use a model of static, in terms of pagination, front page with 10 posts.
At the moment i’m happy but question with query_posts() pagination is still there. Im using query_posts(‘cat=1,4’); – and also played with posts_per_page= parameter, showposts= . None of them make second page. Strange thing is that browser shows address of a second page – ….?page=2 But the page actually shown is first.
Thanks for help
My top secret method for slipping paging into query_posts():
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("paged=$paged&cat=1,4");
?>
Thread Starter
akela
(@akela)
It works….
In my heart i knew that there is a way – WordPress is brilliant software coded by smart guys and supported by very helpful people 🙂
People, pagination problem is over and gone.
Thanks to Kafkaesqui !
Kafkaesqui, you are my hero! 🙂 That is EXCACTLY the piece of code I was looking for. Thanks so much!
Yup – this worked for me, too. Thanks so much!