Title: query_posts and sticky posts problem
Last modified: August 20, 2016

---

# query_posts and sticky posts problem

 *  [ivan2704](https://wordpress.org/support/users/ivan2704/)
 * (@ivan2704)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/)
 * 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

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300015)
 * Try:
 * `if ( is_home() ) {query_posts($query_string.'&cat=3&ignore_sticky_posts=0');}`
 *  Thread Starter [ivan2704](https://wordpress.org/support/users/ivan2704/)
 * (@ivan2704)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300021)
 * It’s not working 🙁
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300024)
 * You may have to write a full custom query instead of concatenating onto the existing
   query.
 *  Thread Starter [ivan2704](https://wordpress.org/support/users/ivan2704/)
 * (@ivan2704)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300028)
 * 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 😛
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300031)
 * Is the sticky post in category 3?
 *  Thread Starter [ivan2704](https://wordpress.org/support/users/ivan2704/)
 * (@ivan2704)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300033)
 * Yes it is 🙂 It is my news category
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300035)
 * 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.
 *  Thread Starter [ivan2704](https://wordpress.org/support/users/ivan2704/)
 * (@ivan2704)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300041)
 * It seems that is only possible way. Thank you for your answers. If anybody comes
   up with something else, write it 🙂

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘query_posts and sticky posts problem’ is closed to new replies.

## Tags

 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 8 replies
 * 2 participants
 * Last reply from: [ivan2704](https://wordpress.org/support/users/ivan2704/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/query_posts-and-sticky-posts-problem/#post-2300041)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
