Skip to content

Instantly share code, notes, and snippets.

@whatjackhasmade
Created July 21, 2017 11:02
Show Gist options
  • Select an option

  • Save whatjackhasmade/10d56d4240d3b64d0cf5c72ae894eb1b to your computer and use it in GitHub Desktop.

Select an option

Save whatjackhasmade/10d56d4240d3b64d0cf5c72ae894eb1b to your computer and use it in GitHub Desktop.

Revisions

  1. Jack Davies created this gist Jul 21, 2017.
    17 changes: 17 additions & 0 deletions exclude_posted_posts.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    <?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;
    ?>