Advertisement
Guest User

Display 1 Post per taxonomy only gives 1 Language

a guest
Aug 22nd, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php get_header() ?>
  2.  
  3. <div class="row" id="main">
  4.     <div class="large-12 columns">
  5.         <ul class="small-block-grid-3 large-block-grid-6">
  6.         <?php
  7.        
  8.         $lang = pll_current_language();
  9.  
  10.         $terms = get_terms( 'kunden' );
  11.        
  12.         foreach( $terms as $term ) :
  13.        
  14.             $args = array(
  15.                 'post_type' => 'portfolio',
  16.                 'kunden' => $term->slug,
  17.                 'posts_per_page' => 1,
  18.                 'lang' => $lang,
  19.             );
  20.             $single = new WP_Query( $args ); ?>
  21.             <?php if ($single->have_posts()) { ?>
  22.            
  23.             <?php while ($single->have_posts()) : $single->the_post(); ?>
  24.            
  25.             <?php get_template_part('project-thumb'); ?>
  26.            
  27.             <?php endwhile; ?>
  28.            
  29.             <?php } ?>
  30.         <?php endforeach; ?>
  31.         </ul>
  32.     </div>
  33.    
  34.    
  35. </div>
  36.  
  37.  
  38. <?php get_footer() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement