Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. <?php $args = array('tax_query' => array(array('taxonomy' => 'post-status','field' => 'slug','terms' => array ('post-status-published')))); $query = new WP_Query( $args );?>
  2. <?php if ( $query->have_posts() ) : $duplicates = []; while ( $query->have_posts() ) : $query->the_post(); ?>
  3.  
  4. <?php if ( in_category( 'first-major' ) ) : ?>
  5. <div class="major"><div class="major-first">
  6. major and first - <?php the_title();?><br>
  7. <?php $duplicates[] = get_the_ID(); ?>
  8. </div>
  9. <?php endif; endwhile; ?>
  10. <?php $query->rewind_posts(); ?>
  11.  
  12. <?php while ( $query->have_posts() ) : $query->the_post(); ?>
  13.  
  14. <?php if (( in_category( 'major' ) ) && (!in_category( 'first-major'))) : if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
  15. major - <?php the_title(); ?><br>
  16. <?php $duplicates[] = get_the_ID(); ?>
  17. <?php endif;?>
  18.  
  19. <?php endwhile; ?></div>
  20. <?php $query->rewind_posts(); ?>
  21.  
  22. <?php while ( $query->have_posts() ) : $query->the_post(); ?>
  23.  
  24. <?php if (( in_category( 'major' ) ) && (!in_category( 'first-major'))) : if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
  25. major - <?php the_title(); ?><br>
  26. <?php $duplicates[] = get_the_ID(); ?>
  27. <?php endif;?>
  28.  
  29. <?php endwhile; ?></div>
  30. <?php $query->rewind_posts(); ?>
  31.  
  32. <?php while ( $query->have_posts() ) : $query->the_post(); ?>
  33.  
  34. <?php if ( in_category('group-a')) :?>
  35. yes
  36. <?php else :?>
  37. no
  38. <?php endif;?>
  39. <?php if ( in_category( 'group-a-first' ) ) : ?>
  40. group a and first - <?php the_title(); ?><br>
  41. <?php $duplicates[] = get_the_ID(); ?>
  42. <?php endif;?>
  43.  
  44. <?php endwhile; ?>
  45. <?php $query->rewind_posts(); ?>
  46.  
  47. <?php while ( $query->have_posts() ) : $query->the_post(); ?>
  48.  
  49. <?php if (( in_category( 'group-a' ) ) && (!in_category( 'group-a-first'))) : if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
  50. group a - <?php the_title(); ?><br>
  51. <?php $duplicates[] = get_the_ID(); ?>
  52. <?php endif;?>
  53.  
  54. <?php endwhile; ?>
  55. <?php $query->rewind_posts(); ?>
  56.  
  57. <?php while ( $query->have_posts() ) : $query->the_post(); ?>
  58.  
  59. <?php if ( in_category( 'group-b-first' ) ) : ?>
  60. group b and first - <?php the_title(); ?><br>
  61. <?php $duplicates[] = get_the_ID(); ?>
  62. <?php endif;?>
  63.  
  64. <?php endwhile; ?>
  65. <?php $query->rewind_posts(); ?>
  66.  
  67. <?php while ( $query->have_posts() ) : $query->the_post(); ?>
  68.  
  69. <?php if ( in_array( get_the_ID(), $duplicates ) ) continue; ?>
  70. <?php the_title();?><br>
  71.  
  72. <?php endwhile; wp_reset_postdata(); endif; ?>
  73.  
  74.  
  75. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement