ivan2704
Member
Posted 8 months ago #
Hi folks, I have problem with query_posts command and sticky posts. I am using custom twentyten child theme and in themes index.php I inserted this code
if ( is_home() ) {query_posts($query_string.'&cat=3');}
so only one category is on the front page. So my problem is when I make post sticky nothing happens. Post remains on it's place.
I tried removing that code and then it was OK. But i need this because I want to show only one category on front page. Does anybody have a solution for my problem? Thanks
Try:
if ( is_home() ) {query_posts($query_string.'&cat=3&ignore_sticky_posts=0');}
ivan2704
Member
Posted 8 months ago #
You may have to write a full custom query instead of concatenating onto the existing query.
ivan2704
Member
Posted 8 months ago #
I was searching the google a little bit now and I realized that this won't be so easy to fix :D. Life is hard :P
Is the sticky post in category 3?
ivan2704
Member
Posted 8 months ago #
Yes it is :) It is my news category
You could try doing this using two Loops - the first pulling in the sticky post and the second pulling in all of the other posts in category 3.
ivan2704
Member
Posted 8 months ago #
It seems that is only possible way. Thank you for your answers. If anybody comes up with something else, write it :)