Created
October 18, 2015 18:59
-
-
Save joedooley/3c6f74c1ff8a6725656d to your computer and use it in GitHub Desktop.
slick-slider
This file contains 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 | |
// WP_Query arguments for slide CPT | |
$args = array ( | |
'post_type' => 'slide', | |
'posts_per_page' => '5' | |
); | |
// The Query | |
$query = new WP_Query( $args ); | |
// The Loop | |
if ( $query->have_posts() ) { | |
echo '<div class="catering-slides">'; | |
while ( $query->have_posts() ) { | |
$query->the_post(); | |
echo '<div class="catering-slide">'; | |
$image = the_post_thumbnail( 'large' ); | |
printf( '<div class="slide-image"><a href="%s" rel="bookmark"><img src="%s"/></a></div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) ); | |
?> | |
<div class="catering-slide-caption"> | |
<div class="catering-slide-excerpt">; | |
<h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="slide-title"><?php the_title(); ?></a></h2> | |
<?php the_content(); ?> | |
</div> | |
</div> | |
</div> | |
<?php } | |
echo '</div>'; | |
} else { | |
// no posts found | |
} | |
// Restore original Post Data | |
wp_reset_postdata(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment