Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $category = get_field('experience_shortcode_category');
- $count = get_field('experience_shortcode_number_of_posts_to_show');
- $experiences = get_posts(
- array(
- 'posts_per_page' => $count,
- 'cat' => $category
- )
- );
- $my_query = new wp_query( $experiences );
- echo "<div class='experience_posts'>";
- if( $my_query->have_posts() ) {
- while ( $my_query->have_posts() ) : $my_query->the_post();
- ?>
- <div class='experience'>
- <?php the_post_thumbnail( 'thumb' ); ?>
- <p class='experience_title'><strong><?php the_title();?></strong></p>
- <?php the_excerpt(); ?>
- </div>
- <?php
- endwhile;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement