Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Specific Post format post display
- <?php
- // the query
- $slider_post = new WP_Query(array(
- 'post_type' => 'post',
- 'posts_per_page' => 3,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'post_format',
- 'field' => 'slug',
- 'terms' => array( 'post-format-gallery' ),
- 'operator' => 'IN'
- )
- )
- ));
- ?>
- <?php if ($slider_post->have_posts()):
- while ($slider_post->have_posts()) : $slider_post->the_post();
- if( get_post_format() == 'gallery' ) : ?>
- //My html dynamic code here
- <?php endif;
- endwhile;
- else :
- echo wpautop('Sorry, no posts were found');
- endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement