Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $args = array('tax_query' => array(array('taxonomy' => 'post-status','field' => 'slug','terms' => array ('post-status-published')))); $query = new WP_Query( $args );?>
- <?php if ( $query->have_posts() ) : $duplicates = []; while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if ( in_category( 'first-major' ) ) : ?>
- <div class="major"><div class="major-first">
- major and first - <?php the_title();?><br>
- <?php $duplicates[] = get_the_ID(); ?>
- </div>
- <?php endif; endwhile; ?>
- <?php $query->rewind_posts(); ?>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if (( in_category( 'major' ) ) && (!in_category( 'first-major'))) : if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
- major - <?php the_title(); ?><br>
- <?php $duplicates[] = get_the_ID(); ?>
- <?php endif;?>
- <?php endwhile; ?></div>
- <?php $query->rewind_posts(); ?>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if (( in_category( 'major' ) ) && (!in_category( 'first-major'))) : if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
- major - <?php the_title(); ?><br>
- <?php $duplicates[] = get_the_ID(); ?>
- <?php endif;?>
- <?php endwhile; ?></div>
- <?php $query->rewind_posts(); ?>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if ( in_category('group-a')) :?>
- yes
- <?php else :?>
- no
- <?php endif;?>
- <?php if ( in_category( 'group-a-first' ) ) : ?>
- group a and first - <?php the_title(); ?><br>
- <?php $duplicates[] = get_the_ID(); ?>
- <?php endif;?>
- <?php endwhile; ?>
- <?php $query->rewind_posts(); ?>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if (( in_category( 'group-a' ) ) && (!in_category( 'group-a-first'))) : if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
- group a - <?php the_title(); ?><br>
- <?php $duplicates[] = get_the_ID(); ?>
- <?php endif;?>
- <?php endwhile; ?>
- <?php $query->rewind_posts(); ?>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if ( in_category( 'group-b-first' ) ) : ?>
- group b and first - <?php the_title(); ?><br>
- <?php $duplicates[] = get_the_ID(); ?>
- <?php endif;?>
- <?php endwhile; ?>
- <?php $query->rewind_posts(); ?>
- <?php while ( $query->have_posts() ) : $query->the_post(); ?>
- <?php if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
- <?php the_title();?><br>
- <?php endwhile; wp_reset_postdata(); endif; ?>
- </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement