


Like the first one, the second loop uses the query_posts() function with the post_not_in parameter. Just before the loop starts, I create a PHP array named $ids, which will receive all IDs of the posts returned by this loop. The showposts parameter allows you to get the specified number of posts. The first loop starts with the very useful query_posts() function, which allows you to specify a wide range of parameters to be used by the loop. Save your index.php file and admire the results!

Once that’s done, it’s time to apply our second loop and get all posts, excepted the ones we have already outputted in the first loop: $ids))
#Wordpress move date up by one year code
Open the index.php file, and paste the following code to output your “featured” posts: Nothing hard here: we’re just going to get the eight most recent posts using the showposts parameter. While using two loops is very easy to do, preventing duplicate posts from displaying is not… until, that is, you learn this easy method of preventing them. Most modern themes and all “magazine” themes display at least two loops on the blog’s home page these can be used, for example, for a “featured posts” section. Use More Than One Loop On A Page, Without Printing Duplicate Posts
