Advertisement
Guest User

Untitled

a guest
Oct 29th, 2015
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1.  
  2. <?php
  3. $args = array(
  4.         'post_type' => 'results',
  5.         'tax_query' => array(
  6.                 'relation' => 'AND',
  7.                 array(
  8.                         'taxonomy' => 'Year',
  9.                         'field'    => '2015',
  10.                         'terms'    => 'cb_result_year',
  11.                 ),
  12.                 array(
  13.                        
  14.                         'taxonomy' => 'Class',
  15.                         'field'    => 'Eight',
  16.                         'terms'    => 'cb_result_class',
  17.                 ),
  18. array(
  19.                        
  20.                         'taxonomy' => 'Semester',
  21.                         'field'    => '1st Semester',
  22.                         'terms'    => 'cb_result_semester',
  23.                 ),
  24.         ),
  25. );
  26. $query = new WP_Query( $args );
  27.  
  28.  
  29.  
  30. ?>
  31. <?php if($query->have_posts()) : ?> <?php while ($query->have_posts()) : $query->the_post(); ?>
  32. <?php the_title();?>
  33.  
  34. <?php endwhile;?>
  35. <?php else : ?>
  36.  
  37. <h2>sorry don't have any post</h2>
  38.  
  39. <?php endif;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement