Advertisement
bowenac

Untitled

Aug 4th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1.     $category = get_field('experience_shortcode_category');
  2.     $count = get_field('experience_shortcode_number_of_posts_to_show');
  3.  
  4.     $experiences = get_posts(
  5.         array(
  6.             'posts_per_page' => $count,
  7.             'cat' => $category
  8.         )
  9.     );
  10.  
  11.     $my_query = new wp_query( $experiences );
  12.  
  13.     echo "<div class='experience_posts'>";
  14.  
  15.     if( $my_query->have_posts() ) {
  16.         while ( $my_query->have_posts() ) : $my_query->the_post();
  17.             ?>
  18.             <div class='experience'>
  19.             <?php the_post_thumbnail( 'thumb' ); ?>
  20.             <p class='experience_title'><strong><?php the_title();?></strong></p>
  21.             <?php the_excerpt(); ?>
  22.             </div>
  23.             <?php
  24.         endwhile;
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement