Hi @brunoairam,
I understand the issue. Blocks need to be “executed”. Though they are regular HTML, WordPress needs to know that the HTML is for blocks.
Right now it is not expected for Shortcoder to contain block HTML.
I’ll check and get back to you with code to execute the blocks.
Thanks,
Aakash
Thanks a lot, waiting for your feedback.
Hi @brunoairam,
Can you please paste below code in your theme’s function.php file or via site specific plugin?
https://www.aakashweb.com/articles/create-site-specific-wordpress-plugin-custom-code/
function sc_execute_blocks( $shortcode ){
if( !is_array( $shortcode ) ){
return $shortcode;
}
$shortcode[ 'content' ] = do_blocks($shortcode[ 'content' ]);
return $shortcode;
}
add_filter( 'sc_mod_shortcode', 'sc_execute_blocks', 10, 1 );
This should execute the blocks in shortcode.
I’ll see if this option can be added to the plugin in the future version of the plugin.
Thanks,
Aakash
Hello Aakash,
I am Justine, working with Bruno.
We did paste the code in theme’s function.php file.
The PDF embedder block is working now. But the Vimeo block still doesn’t show : https://drive.google.com/file/d/1Rg0jy6oVZWqGxH8UFTQB0jWhijs_Poko/view?usp=sharing
Thanks for your help!
Hi Justine,
I tried the vimeo “embed block” and it is working on my end.
Please use the “vimeo embed” block and not just a plain vimeo link. The block code looks like below.
<!-- wp:embed {"url":"https://vimeo.com/channels/bestofstaffpicks/652309700","type":"video","providerNameSlug":"vimeo","responsive":true,"className":"wp-embed-aspect-16-9 wp-has-aspect-ratio"} -->
<figure class="wp-block-embed is-type-video is-provider-vimeo wp-block-embed-vimeo wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
https://vimeo.com/channels/bestofstaffpicks/652309700
</div></figure>
<!-- /wp:embed -->
Thanks