36 lines
923 B
PHP
36 lines
923 B
PHP
<?php
|
|
/**
|
|
* IGNY8 Featured Image Block
|
|
* Displays featured image with caption if available
|
|
*
|
|
* @package Igny8Bridge
|
|
*/
|
|
|
|
// Exit if accessed directly
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
$image_url = wp_get_attachment_image_url($featured_image_id, 'full');
|
|
$image_alt = get_post_meta($featured_image_id, '_wp_attachment_image_alt', true);
|
|
|
|
if (!$image_url) {
|
|
return;
|
|
}
|
|
?>
|
|
|
|
<div class="igny8-featured-image-block igny8-featured-fullwidth">
|
|
<div class="igny8-featured-image-wrapper">
|
|
<img src="<?php echo esc_url($image_url); ?>"
|
|
alt="<?php echo esc_attr($image_alt ?: get_the_title()); ?>"
|
|
class="igny8-featured-image"
|
|
loading="lazy">
|
|
</div>
|
|
|
|
<?php if ($featured_image_caption): ?>
|
|
<div class="igny8-image-caption">
|
|
<p class="igny8-caption-text"><?php echo esc_html($featured_image_caption); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|