Created
December 6, 2012 22:48
-
-
Save gicolek/4229191 to your computer and use it in GitHub Desktop.
Sample WP_Query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'slider', | |
'posts_per_page' => -1, | |
); | |
$slider_query = new WP_Query( $args ); | |
?> | |
<?php if ( $slider_query->have_posts() ): ?> | |
<?php while ( $slider_query->have_posts() ): $slider_query->the_post(); ?> | |
<?php if ( has_post_thumbnail() ): ?> | |
<?php the_post_thumbnail( 'slider' ); ?> | |
<?php endif; ?> | |
<?php endwhile; ?> | |
<?php endif; ?> | |
<?php wp_reset_postdata(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment