<?php if ($query->have_posts()) : ?>
<ul class="kh-latest-post wp-block-latest-posts__list has-dates has-author wp-block-latest-posts ">
<?php while ($query->have_posts()) : ?>
<?php $query->the_post(); ?>
<li>
<?php if (has_post_thumbnail()) { ?>
<div class="wp-block-latest-posts__featured-image alignleft">
<a href="<?php the_permalink(); ?>" class="fusion-no-lightbox">
<img width="300" height="150"
src="<?php echo get_the_post_thumbnail_url(); ?>"
class="attachment-medium size-medium wp-post-image lazyautosizes lazyloaded"
alt="<?php echo get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true); ?>"
style="max-width:75px;max-height:75px;" loading="lazy" sizes="75px">
</a>
</div>
<?php } ?>
<a class="wp-block-latest-posts__post-title" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
<div class="wp-block-latest-posts__post-author">by <?php the_author(); ?></div>
<time datetime="<?php echo get_the_date('c'); ?>" class="wp-block-latest-posts__post-date"><?php echo get_the_date(); ?></time>
</li>
<?php endwhile; ?>
</ul>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
0 Comments
Post a Comment