Exclude Sticky Posts from the Loop in WordPress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. query_posts(array("post__not_in" =>get_option("sticky_posts")));
  3. if ( have_posts() ) : while ( have_posts() ) : the_post();
  4. ?>

URL: http://www.wpbeginner.com/wp-themes/how-to-exclude-sticky-posts-from-the-loop-in-wordpress

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.