This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: 

Executing shortcodes in Builder elements

  • Creator
    Topic
  • #13366
    srumery
    Participant

    What can we to do allow shortcodes to be executed in Builder Elements? I am using this code to allow shortcodes in a Text Widget.

    add_filter( 'widget_text', 'do_shortcode');

    Is there something similar for Builder?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #13386
    Jason Bobich
    Keymaster

    Hello,

    Shortcodes should already work in most elements. Where specifically are you trying to get them to work?

    #13404
    srumery
    Participant

    Hi Jason,

    Actually, I created a custom builder element that displays text on top of a full width background image. The text comes from a textarea I setup in the element and that’s where I would like to use shortcodes. The button shortcode I added doesn’t fire there. I think I saw a post about this some time ago but I can’t find it now.

    The custom builder element has a unique ID ($element_id = 'rum_landing_page_intro_section';) when added to the theme by using themeblvd_add_builder_element.

    I have reviewed the Layout Builder (API) documentation and I don’t see anything referencing shortcode support.

    Is there a way to make sure shortcodes are executed in my custom builder element?

    #13409
    Jason Bobich
    Keymaster

    So, in your custom element’s callback function that you created (which outputs it onto the screen), you’d wrap do_shortcode() around whatever you’re outputting that you want shortcodes to work on. Or am I missing something?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.