• hello,
    i am building a site for my client and i need some help with this issue.
    Even though i have added add_filter( ‘widget_text’, ‘do_shortcode’); in my functions.php file, the shortcode is not executed inside the text widget i am using. To be more specific, the block i use is elementor tabs. I have tried with other tabs plugins, but it always comes down to the shortcode inside the text widget. Any help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I just did a test with Ninja Form’s shortcode ([ninja_form id=1]), and:

    1) I didn’t need to add the filter code to use the shortcode in a native WordPress TEXT WIDGET. The shortcode worked out of the box, and the form was displayed.

    2) I added the same shortcode into a CUSTOM HTML widget, but I only got the raw shortcode. But the shortcode got executed after I added the line add_filter('widget_text', 'do_shortcode'); in the theme’s functions.php file.

    I tried with the WP TABS plugin’s shortcode… and got the same result as above.

    So it seems you shouldn’t even need to add the filter code to get a shortcode working in a TEXT widget, and there must be some other reason why your shortcodes in the widget aren’t working.

    Thread Starter iothio

    (@iothio)

    yes, it seems that the problem is somewhere else, maybe it has to do with the theme? i don’t know. frustrated…Just to be clear, the text editor is inside the elementor tabs block. i want the shortcode of a slider inside the tab block.

    • This reply was modified 4 years, 11 months ago by iothio.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘shortcode in text widget not working’ is closed to new replies.