Shortcodes in Cover Block
-
Using shortcodes in the content of a cover block that’s used in a widget don’t seem to work – only the raw shortcode displays. I’ve tried shortcodes generated by a number of gallery and form plugins, but none of them work if the cover block is in a widget. Shortcodes are fine in a cover block used in the body of a page or post. Shortcodes are fine when used in a text widget, so I don’t think it’s a theme issue. Is this an issue with specific shortcodes generated by a plugin, or something else? Thanks in advance.
-
This topic was modified 4 years, 1 month ago by
Steven Stern (sterndata).
-
This topic was modified 4 years, 1 month ago by
-
Do you have a concrete example at hand where this does not work?
Does it only not work in widgets or does it also not work in the normal Gutenberg editor?
Only doesn’t work in a cover block created in a widget, or created as a reusable block to use in a widget. It’s fine in the post/page gutenberg editor – displays as it should. I’ve used the shortcode for Contact Form 7, a variety of carousel plugins and a Smart Slider plugin shortcode. Use on a cover block on a page/post/cpt – all is fine. Cover block in widget – only displays the raw shortcode.
Unfortunately, I cannot reproduce the described on my own system. I can create a cover block without any problems, which in turn contains a shortcode block. It looks like this:
I tested this with Astra and TwentyTwentyOne as theme.
Assumption: You enter the shortcodes in the paragraph block, not in the shortcode block.
Not sure you’ve understood – it’s not the insertion of a shortcode in a cover block that’s the issue. Cover blocks with shortcodes in body of content work fine. It’s getting a cover block that contains a shortcode to display correctly in a widget area. Builds correctly, doesn’t display correctly.
But, after more testing cover blocks with shortcodes in widgets on my Understrap child theme, as well as TwentyTwenty, I’m finding the issue is very convoluted – some plugin shortcodes work, others don’t; some work in X widget area, but not in Y widget area. So I’m going to continue testing.
The topic ‘Shortcodes in Cover Block’ is closed to new replies.