Hi Marumoro,
Thank you for reaching out to us here.
As an example, I created a custom Post Meta field mymetaname
: https://share.getcloudapp.com/NQuNYoLy
I then created a Block Element with a Dynamic Headline Block as such: https://share.getcloudapp.com/04uEx2bJ
Now, I added this code through plugin Code Snippets:
add_filter( 'generate_dynamic_element_text', function( $my_post_meta, $block ){
if ( 'post-meta' === $block['attrs']['gpDynamicTextType'] && 'mymetaname' === $block['attrs']['gpDynamicTextCustomField']) {
$my_post_meta = number_format_i18n(floatval(get_post_meta(get_the_ID(),$block['attrs']['gpDynamicTextCustomField'])[0]));
}
return $my_post_meta;
},15,2);
Here it is working on my site: https://share.getcloudapp.com/Z4u7jKlo
Kindly replace mymetaname
with your meta field name.
Hope this helps! 🙂