Created
May 28, 2014 02:20
-
-
Save alisonmf/1549f57493cbaf4201b2 to your computer and use it in GitHub Desktop.
PHP: simple WordPress slider w/ ACF
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
<section class="flexslider-sidebar"> | |
<ul class="slides"> | |
<?php $args=array( | |
'post_type' => 'platinum_logos', | |
'posts_per_page' => 4, | |
'orderby' => 'rand' | |
); | |
$my_query = null; | |
$my_query = new WP_Query($args); | |
if ( $my_query->have_posts() ) { | |
while ($my_query->have_posts()) : $my_query->the_post(); | |
?> | |
<?php if ( has_post_thumbnail() ) { ?> | |
<li> | |
<a target="_blank" href="<?php the_field('website_address'); ?>"> | |
<?php the_post_thumbnail(); ?> | |
</a> | |
</li> | |
<?php } ?> | |
<?php endwhile; } wp_reset_query(); ?> | |
</ul><!-- /.slides --> | |
</section><!-- /.flexslider --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment