WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my theme, I'm using front-page.php for the static front page. I'm also using a page to store the content on the static front page. The front-page.php file is set up to show the content from that page.

However, in the front-page.php file, I also want to show all of my blog's sticky posts below that content. How would I do that?

share|improve this question
up vote 1 down vote accepted

Something like this should work:

$sticky = get_option( 'sticky_posts' );
if ( !empty( $sticky ) ) {  // don't show anything if there are no sticky posts
    $args = array(
        'posts_per_page' => -1,  // show all sticky posts
        'post__in'  => $sticky,
        'ignore_sticky_posts' => 1
    $query = new WP_Query( $args );
    if ( $query->have_posts() ) {
        // display your sticky post here (however you like to do it)

You should place this in your front-page.php file. It will select all sticky posts and show them.

share|improve this answer
Make sure to also add a wp_reset_postdata(); after your if statement to reset the $post global to the main query. – jjeaton Aug 7 '13 at 15:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.