File: /home/imensosw/webofai.imenso.co/wp-content/themes/webofai_theme/loops/news-card.php
<?php
$post_id = @$args['post_id'] ?: get_the_ID();
$post_title = get_the_title($post_id);
$post_permalink = get_the_permalink($post_id);
$post_image = \Theme\Helpers::get_post_thumbnail($post_id, 'img-1135-638');
$short_description = get_post_meta($post_id, 'short_description', true);
$post_description = $short_description ? get_post_meta($post_id, 'short_description', true) : get_the_excerpt($post_id);
$terms = get_the_terms($post_id,'digital-marketing-tags' );
?>
<div id="post-id-<?= $post_id ?>" class="tool-card iv-st-from-bottom">
<div class="card-image-wrapper">
<a href="<?= $post_permalink ?>" class="card-image">
<picture class="image-wrapper aspect-ratio">
<?= $post_image ?>
</picture>
</a>
</div>
<div class="content-wrapper">
<div class="top-part">
<a href="<?= $post_permalink ?>"
class="title headline-5">
<?= $post_title ?>
</a>
</div>
<?php if ($post_description) { ?>
<div class="short_description">
<?= $post_description ?> </div>
<?php } ?>
<div class="bottom-part">
<div class="tabs-wrapper">
<?php if (!empty($terms) && !is_wp_error($terms)) {
?>
<a href="<?= get_term_link($terms[0]) ?>" class="tab">
<?= $terms[0]->name ?>
</a>
<?php } ?>
</div>
<div class="mobile-tabs-wrapper">
<?php if (is_user_logged_in()) {
$user_id = get_current_user_id();
?>
<button
class=" bottom-tab like-icon favorite-button <?= isset($favorites_users[$user_id]) ? 'favorite' : '' ?>"
aria-label="add to favorite" data-post-id="<?= $post_id ?>"
data-user-id="<?= $user_id ?>">
<svg width="17" height="17" viewBox="0 0 17 17" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M14.4908 3.25219C14.1446 2.89484 13.7336 2.61136 13.2813 2.41795C12.8289 2.22455 12.3441 2.125 11.8544 2.125C11.3648 2.125 10.8799 2.22455 10.4276 2.41795C9.9752 2.61136 9.56421 2.89484 9.21805 3.25219L8.49966 3.99348L7.78126 3.25219C7.08205 2.5307 6.13372 2.12537 5.14489 2.12537C4.15606 2.12537 3.20773 2.5307 2.50852 3.25219C1.80932 3.97368 1.4165 4.95223 1.4165 5.97257C1.4165 6.99291 1.80932 7.97146 2.50852 8.69295L8.49966 14.875L14.4908 8.69295C14.8371 8.33577 15.1118 7.91168 15.2993 7.4449C15.4867 6.97813 15.5832 6.47783 15.5832 5.97257C15.5832 5.46732 15.4867 4.96701 15.2993 4.50024C15.1118 4.03347 14.8371 3.60938 14.4908 3.25219Z"
stroke="#8690A2" stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
</button>
<?php } ?>
</div>
</div>
</div>
</div>