WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Parent Category and Child post twice (duplicate posts) (2 posts)

  1. rdqrdq
    Member
    Posted 3 years ago #

    Is there any way to just select either the Parent or Child category and have one post from either instead of both posting once (duplicate posts)?

    Thanks in advance!

  2. rdqrdq
    Member
    Posted 3 years ago #

    My questions may not have been the most easy to understand. I fixed my problem though.

    I was having duplicate posts because I was checking for the same category twice in my loop.php

    The main reason for all of this was to have different formatting on the same post, but on different pages.

    Fixed this by removing parent child hierarchy. Then made another loop-2.php and referred to it from the appropriate page, so:
    index.php --> loop.php
    news.php --> loop-2.php

    I referred to the loop-2.php like so on the custom news page:

    <?php
    //REWIND LOOP
     rewind_posts();
     query_posts('category_name=ride&showposts=5');
    
     get_template_part( 'loop', '2' );
    
     ?>

    Tah dah!

Topic Closed

This topic has been closed to new replies.

About this Topic