I'm using my index.php to display post archive pages rather than a specific archive.php file.

This works fine, however sticky posts do not stick to the top of it. They do however, stick to the top of the posts page.

Are sticky posts not supposed to stick to the top of archive pages?

Here is the code for the loop I'm using; loop-index.php - http://pastebin.com/NHi2tsNM

Am I doing something wrong? Or is this just default functionality?

  • Suprising that archives page doesn't do stickying, if you don't want to code there are plugins eg 'Sticky Post Settings' click settings->categories Jul 5, 2021 at 11:15

1 Answer 1


By default, sticky posts only stick to the top of the first page of the main blog posts index.

The easiest way to show sticky posts in other contexts is probably via a custom loop, e.g.:

$sticky_posts = new WP_Query( array(
    'post__in' => get_option( 'sticky_posts' )
) );

if ( $sticky_posts->have_posts() ) : while ( $sticky_posts->have_posts() ) : $sticky_posts->the_post() );
    // Loop markup here
endwhile; endif;

You would place that before your normal loop output, and wrap it in any conditionals that you might need (to account for context, pagination, etc.)

  • Ahh I had a feeling that might have been the case. Thanks for clearing it up!
    – user39214
    Oct 10, 2013 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy