File: /home/zwafgyp/dodolodge-net/wp-content/themes/hotel-wp/inc/widgets/testimonials/tpl/layout-4.php
<?php
/**
* Template for displaying default element.
*
*
* @author ThimPress
* @package Thim_Builder/Templates
* @version 1.0.0
* @author Thimpress, tuanta
*/
$layout = ( isset( $instance['layout'] ) && $instance['layout'] != '' ) ? $instance['layout'] : 'default';
$css_animation = esc_attr( $instance['css_animation'] );
$title = $instance['title'];
$auto = esc_attr( $instance['auto'] );
$number_testimonials = esc_attr( $instance['number-posts'] );
$img_link_default = get_bloginfo( 'template_directory' ) . '/assets/images/testimonials-default.jpg';
$testimonials_args = array(
'post_type' => 'testimonials',
'posts_per_page' => $instance['number-posts'],
'ignore_sticky_posts' => true,
);
$testimonials_qurey = new WP_Query( $testimonials_args );
?>
<div class="thim-testimonials-wrap <?php echo esc_attr($layout) ?>">
<div class="thim-testimonials owl-carousel owl-theme" data-auto="0"
data-animation="<?php echo $css_animation; ?>" data-testimonials="<?php echo $number_testimonials; ?>">
<?php if ( $testimonials_qurey->have_posts() ) : while ( $testimonials_qurey->have_posts() ) : $testimonials_qurey->the_post(); ?>
<div class="testimonials-item">
<p class="content"><?php echo get_the_excerpt(); ?></p>
<div class="title"><?php echo get_the_title(); ?></div>
<?php
$regency = get_post_meta( get_the_ID(), 'regency', true );
if ( $regency ) {
?>
<div class="regency"><?php echo get_post_meta( get_the_ID(), 'regency', true ); ?></div>
<?php
}
?>
<div class="rating"><span class="number">5</span></div>
</div>
<?php endwhile;
wp_reset_postdata();
endif; ?>
</div>
<div class="thim-testimonial-custom-dots owl-carousel owl-theme">
<?php if ( $testimonials_qurey->have_posts() ) : while ( $testimonials_qurey->have_posts() ) : $testimonials_qurey->the_post(); ?>
<div class="img-dot">
<?php if ( has_post_thumbnail() ) : ?>
<?php
$image_url = wp_get_attachment_image_url( get_post_thumbnail_id( get_the_ID() ), [ 72, 72 ] );
?>
<img src="<?php echo esc_url( $image_url ) ?>">
<?php else: ?>
<img src="<?php echo esc_url( $img_link_default ); ?>"/>
<?php endif; ?>
</div>
<?php endwhile;
wp_reset_postdata();
endif; ?>
</div>
</div>