You have to code that functionality. Right now, both work independently
Hi @a2hostingrj
Thanks by your reply!
I will look a way to do it.
Regards,
Tony
Hi @a2hostingrj
Please, i have created these shortcodes for post thumbnail informations:
add_shortcode('thumbnail_id', 'thumbnail_with_caption_shortcode_3');
function thumbnail_with_caption_shortcode_3($atts) {
global $post;
$thumbnail = get_the_post_thumbnail($post->ID);
$thumbnail_id = get_post_thumbnail_id();
return $thumbnail_id;
}
add_shortcode('thumbnail_url', 'thumbnail_with_caption_shortcode_2');
function thumbnail_with_caption_shortcode_2($atts) {
global $post;
$thumbnail = get_the_post_thumbnail($post->ID);
$thumbnail_url = wp_get_attachment_url( get_post_thumbnail_id( $id ) );
//$thumbnail_url = get_permalink(get_post_thumbnail_id());
return $thumbnail_url;
}
add_shortcode('thumbnail_caption', 'thumbnail_with_caption_shortcode');
function thumbnail_with_caption_shortcode($atts) {
global $post;
$thumbnail = get_the_post_thumbnail($post->ID);
$thumbnail_id = get_post_thumbnail_id();
$thumbnail_caption = get_post($thumbnail_id)->post_excerpt;
return $thumbnail_caption;
}
And my cover image code is:
<!-- wp:cover {"url":"[thumbnail_url]","id":[thumbnail_id]} -->
<div class="wp-block-cover has-background-dim"><img class="wp-block-cover__image-background wp-image-[thumbnail_id]" alt="[thumbnail_caption]" src="[thumbnail_url]" data-object-fit="cover"/><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Escreva o título...","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size"></p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:cover -->
Shortcodes for wp:cover are not working, just inside thd div they are working as i saw at Inspect of browser.
Could you help me understanding why its not working?
Thanks and Regards,
Tony