Completely exclude Sticky posts from the Loop


/ 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/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+wpbeginner+%28Wordpress+for+Beginners%29

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.