Skip to main content
1 of 2

Exclude all sticky posts front page twenty twelve

I am attempting to exclude all sticky posts from my front page in twenty twelve theme. I have attempted the following. I am making all changes to the child theme.

  1. To remove the following code from content.php

    <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
    <div class="featured-post">
        <?php _e( 'Featured post', 'twentytwelve' ); ?>
    </div>
    <?php endif; ?>
    
  2. Add following code to index.php before the loop(this removed sticky posts but broke pagination)

    get_option( 'sticky_posts' ) ) ); ?>

This is the loop in index.php (pretty much standard index.php for twenty twelve.

        <?php while ( have_posts() ) : the_post(); ?>
            <?php get_template_part( 'content', get_post_format() ); ?>



        <?php endwhile; ?>


        <?php twentytwelve_content_nav( 'nav-below' ); ?>

Could someone please advise me on what I should exactly put into this loop to not show any sticky posts on index.php?

Thank you for your time.