-
-
Save tdmrhn/21f8460e9d89b7a9c14445163ae85909 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( | |
'blocksy:archive:render-card-layers', | |
function ($layers, $prefix, $featured_image_args) { | |
$post_id = get_the_ID(); | |
if ( | |
get_post_type($post_id) !== 'blogger-template' | |
|| | |
has_post_thumbnail($post_id) | |
) { | |
return $layers; | |
} | |
$bt_image_url = rwmb_get_value('bt_image_url', $post_id); | |
$alt_text = 'Check Out ' . rwmb_get_value('bt_name', $post->ID) . ' Premium Blogger Template'; | |
$featured_image_args['html_atts']['class'] = $featured_image_args['class']; | |
unset($featured_image_args['class']); | |
$featured_image_args['img_atts'] = []; | |
$featured_image_args['img_atts']['alt'] = $alt_text; | |
$layers['featured_image'] = blocksy_simple_image( | |
$bt_image_url, | |
$featured_image_args | |
); | |
return $layers; | |
}, | |
10, 3 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment