Created
July 21, 2017 11:02
-
-
Save whatjackhasmade/10d56d4240d3b64d0cf5c72ae894eb1b to your computer and use it in GitHub Desktop.
Use More Than One Loop On A Page, Without Printing Duplicate Posts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
query_posts('showposts=8'); | |
$ids = array(); | |
while (have_posts()) : the_post(); | |
$ids[] = get_the_ID(); | |
the_title(); | |
the_content(); | |
endwhile; | |
?> | |
<?php | |
query_posts(array('post__not_in' => $ids)); | |
while (have_posts()) : the_post(); | |
the_title(); | |
the_content(); | |
endwhile; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment