File: D:/HostingSpaces/KLeeuwen/samenbouwen.in/wwwroot/wp-content/themes/Avada/include/slider_old.php
<style type="text/css">
</style>
<?php
$args = array('post_type' => array( 'slider'), 'post_status' => 'publish');
$query = new WP_Query($args);
$firstSliderImg = $captions = $firstImg = '';
if($query->found_posts) {
while ( $query->have_posts() ) : $query->the_post();
if(strpos(strtolower(get_the_title()), 'homepage') !== false) { ?>
<div class="slider-wrapper theme-default">
<div class="ribbon"></div>
<div id="nivoslider-4" class="nivoSlider">
<?php
if(have_rows('slider_item')) {
$i = 0;
while ( have_rows('slider_item') ) : the_row();
$image = get_sub_field('image');
$text = trim(html_entity_decode(get_sub_field('text')));
if(substr($text, 0,1) == '"') {
$pos = strpos($text, '"', 1);
$quote = substr($text, 1, $pos - 1);
$author = substr($text, $pos + 1);
$text = '<div class="sliderquote">"'.$quote.'"</div><div class="sliderauthor">'.$author.'</div>';
} else
$text = '<div class="sliderquote">'.$text.'</div>';
if($i == 0) {
$firstSliderImg = $image['url'];
$firstImg = $image;
}
if($url = get_sub_field('url'))
echo '<a href="'.$url.'">';
echo '<img src="'.$image['url'].'" alt="'.$image['alt'].'" title="#slidercap'.$i.'" />';
$captions .= '<div id="slidercap'.$i.'" class="nivo-html-caption">'.$text.'</div>';
if($url)
echo '</a>';
$i++;
endwhile;
}?>
</div>
</div>
<?php echo $captions;?>
<script type="text/javascript">
$(window).load(function() {
jQuery("#nivoslider-4").nivoSlider({
effect:"random",
slices:15,
boxCols:8,
boxRows:4,
animSpeed:500,
pauseTime:3000,
startSlide:0,
directionNav:true,
controlNav:true,
controlNavThumbs:false,
pauseOnHover:true,
manualAdvance:false,
afterLoad: function(){
if($('#header .fright').is(":visible") == false) {
//$('.maincont').css('top', (-1) * parseInt($('#nivoslider-4').height()));
//alert($('#nivoslider-4').height());
}
}
});
});
</script>
<?php
break;
}
endwhile;
if($firstSliderImg) { ?>
<script type="text/javascript">
$('.topimg').css('background-image','url(<?php echo $firstSliderImg ?>)');
$('.topimg').css('background-size','contain');
$('.topimg').css('background-position','0px 0px');
if($('#header .fright').is(":visible"))
$('.topimg').height(<?php echo $firstImg['height'];?>);
</script>
<?php
}
}
?>