Shortcode HTML tags

Hey,

Is there a way to change the default HTML tags of a shortcode element from div to something else, eg h2, p, etc?

Thanks

While it may be possible to do that technically by overriding the element in the child theme and what not, am not sure if the effort is worth when we can simply echo the do_shortcode() in a Code element with your desired tags wrapping around it.

1 Like

OK thanks I’ll keep that in mind. Coming from Oxygen, that was a built in feature of the UI builder, can I put that forward as a feature request?

Please correct me if I’m wrong but I think the point of having a changable tags with a shortcode element is to reduce DOM size. If we could directly apply a template as a shortcode and change the tag to “a” for example, it saves us the extra DOM. What do you think? I actually have need for this feature now as I’m working with a custom button saved as a template which I then reference with a shortcode. I would like to make the shortcode a link after referencing it.

1 Like