File: /home/frenchy/refonte2023/wordpress/wp-content/plugins/ova-dep/templates/elementor/ova_list_dep.php
<?php
$template = $args['template'];
$number_column = $args['number_column'];
$deps = ova_dep_get_department_elements($args);
$count = 0;
?>
<div class="ova_list_dep <?php echo esc_attr( $template ) ?> <?php echo esc_attr( $number_column ) ?>">
<?php if($deps->have_posts() ) : while ( $deps->have_posts() ) : $deps->the_post();
$count++;
$id = get_the_id();
$class_icon = get_post_meta( $id, 'ova_dep_met_class_icon', true );
$title = get_the_title();
$excerpt = ova_dep_custom_text( get_the_excerpt(), 5 );
$thumbnail = wp_get_attachment_image_url( get_post_thumbnail_id( $id ), 'medium' );
if ( $thumbnail == '') {
$thumbnail = \Elementor\Utils::get_placeholder_image_src();
}
?>
<div class="items">
<img class="follow-img" src="<?php echo esc_attr($thumbnail);?>" alt="<?php echo esc_attr($title);?>">
<?php if( $template === 'template1' || $template === 'template5' ) { ?>
<span class="number">
<?php echo sprintf('%02s', $count);?>
</span>
<?php } ?>
<?php if( ! empty( $class_icon ) ) { ?>
<div class="icon">
<i aria-hidden="true" class="<?php echo esc_attr( $class_icon ) ?>"></i>
</div>
<?php } ?>
<?php if($template === 'template4') { ?>
<div class="content-wrapper">
<?php } ?>
<?php if( ! empty( $title ) ){ ?>
<h2 class="title">
<a href="<?php echo get_the_permalink() ?>">
<?php echo esc_html($title); ?>
</a>
</h2>
<?php } ?>
<?php if( ! empty( $excerpt ) && $template === 'template4' ){ ?>
<p class="description">
<?php printf($excerpt); ?>
</p>
<?php } ?>
<?php if($template === 'template4') { ?>
</div>
<?php } ?>
<?php if($template === 'template4') { ?>
<a class="arrow-button" href="<?php echo get_the_permalink() ?>" aria-label="<?php esc_attr_e('View Department','ova-dep');?>">
<i aria-hidden="true" class="ovaicon ovaicon-next-4"></i>
</a>
<?php } ?>
<?php if( $template === 'template3') {?>
<span class="divider"></span>
<?php } ?>
</div>
<?php endwhile; endif; wp_reset_postdata(); ?>
</div>