WordPress.org

Ready to get started?Download WordPress

Forums

Expound
Hiding duplicate posts (1 post)

  1. matatias
    Member
    Posted 5 months ago #

    Hi. I put another loop in the theme to show a single complete post from a certain category, but I don't want it to appear twice in the bottom posts (I've removed that category from the Featured Content). I found this solution
    http://wpengineer.com/1719/filter-duplicate-posts-in-the-loop/
    So I put this code in my added loop
    $do_not_duplicate[] = $post->ID;
    And now I'm supposed to add this code in the main loop
    'post__not_in' => $do_not_duplicate
    Problem is, I don't know where to put it! I found the beginning of the loop in the index.php file, right after I put my "custom" loop.
    Thanks!

Reply

You must log in to post.

About this Theme

About this Topic