Opal-Estate-Pro/templates/shortcodes/agent-carousel.php

37 lines
1.3 KiB
PHP
Raw Normal View History

2019-09-30 11:28:04 +02:00
<?php
$_id = time();
$query = Opalestate_Query::get_agents( array("posts_per_page"=>$limit, 'paged' => $paged), $onlyfeatured );
$item = $column;
$data = [
'slidesPerView' => $item,
'spaceBetween' => 30,
'slidesPerGroup' => $item,
'loop' => false,
];
?>
<div class="opalesate-agent-carousel opalestate-rows">
<?php if ( $query->have_posts() ) : ?>
<div class="opalestate-swiper-play swiper-container" id="postcarousel-<?php echo esc_attr( $_id ); ?>" data-swiper="<?php echo esc_attr( wp_json_encode( $data ) ); ?>">
<div class="swiper-wrapper">
<?php
$column = 5;
$clscol = floor( 12 / $column );
while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="swiper-slide">
<?php echo opalestate_load_template_path( 'content-agent-grid' ); ?>
</div>
<?php endwhile; ?>
</div>
<?php if ( absint( $query->post_count ) > absint( $item ) ) : ?>
<div class="swiper-pagination"></div>
<div class="swiper-button-prev"> <i class="fas fa-angle-left"></i></div>
<div class="swiper-button-next"> <i class="fas fa-angle-right"></i></div>
<?php endif; ?>
</div>
<?php else: ?>
<?php echo opalestate_load_template_path( 'content-no-results' ); ?>
<?php endif; ?>
</div>