Title: Include sticky posts on index
Last modified: September 26, 2016

---

# Include sticky posts on index

 *  [Dot22](https://wordpress.org/support/users/dot22/)
 * (@dot22)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/include-sticky-posts-on-index/)
 * Hello everyone! First of all sorry me for my bad English but isn’t my native 
   language so I’ll do as best as possible to explain my problem.
 * I’ve a site running the last version of WordPress (4.6.1) and I want to display
   the sticky posts at the top of post loop on index.php. My theme’s code is the
   following:
 *     ```
       <?php if (have_posts()) : ?>
       <?php $post = $posts[0]; $c=0; ?>
       <?php
       if( is_home() && !is_paged() ) :
       global $query_string;
       query_posts( $query_string . '&cat=1,2&posts_per_page=7' );
       endif;
       ?>
       <?php /* Start the Loop */ ?>
       <?php while (have_posts()) : the_post(); ?>
       <?php $c++;
       if( !$paged && $c == 1 ) :?>
       FIRST POST STYLE
   
       <?php else :?>
   
       <?php get_template_part( 'content', get_post_format() ); ?>
       <?php endif;?>
       <?php endwhile; ?>
       ```
   
 * Is there any piece of code I’m missing? Thanks in advance! 🙂

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

 *  [ThemeSumo](https://wordpress.org/support/users/themesumo/)
 * (@themesumo)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/include-sticky-posts-on-index/#post-8224021)
 * Have you tried adding `ignore_sticky_posts=0` to your query?
 * See [Sticky Posts](https://codex.wordpress.org/Sticky_Posts) for further reference.
 * Hope this helps.
 *  Thread Starter [Dot22](https://wordpress.org/support/users/dot22/)
 * (@dot22)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/include-sticky-posts-on-index/#post-8224201)
 * Thanks for your reply ThemeSumo. I’ve tried it but didn’t work 🙁
 * There is another way to include the sticky posts?

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

The topic ‘Include sticky posts on index’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Dot22](https://wordpress.org/support/users/dot22/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/include-sticky-posts-on-index/#post-8224201)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
