Forked from rianrietveld/rrwd-genesis-acf-silder-output.php
Last active
August 29, 2015 14:20
-
-
Save samediamba/1edd394ede27dc29cb80 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Home Slider | |
* | |
* Uses the Genesis Responsive slider combined with Advanaced Custom Fields | |
* setting in Dashboard - Instellingen website | |
*/ | |
function rrwd_home_slider() { | |
global $wpdb; | |
if ( !get_field( 'rrwd_acf_slider', 'option' ) ) return; | |
?> | |
<div id="genesis-responsive-slider"> | |
<div class="flexslider"> | |
<ul class="slides"> | |
<?php | |
while( has_sub_field('rrwd_acf_slider', 'option') ) { | |
$image_obj = get_sub_field('rrwd_acf_slider_image', 'option'); | |
$url = $image_obj['url']; | |
$link = get_sub_field('rrwd_acf_slider_link', 'option'); | |
$alt = get_sub_field('rrwd_acf_slider_alt', 'option'); | |
?> | |
<li> | |
<div class="slide-image"> | |
<?php | |
if ( !$link ) { | |
?> | |
<img src="<?php echo $url ?>" alt="<?php echo $alt; ?>" /> | |
<?php | |
} else { | |
?> | |
<a href="<?php echo $link ?>" rel="bookmark"><img src="<?php echo $url ?>" alt="<?php echo $alt; ?>" /></a> | |
<?php | |
} | |
?> | |
</div><!-- end .slide-image --> | |
</li> | |
<?php } ?> | |
</ul><!-- end ul.slides --> | |
</div><!-- end .flexslider --> | |
</div><!-- end #genesis-responsive-slider --> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment