Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi dragoeco,

    It sounds as if your text widgets aren’t set to parse shortcodes. By default, WordPress text widgets do not do this. In order to enable shortcodes in text widgets, you must add the following code to your theme’s functions.php file.

    add_filter('widget_text', 'do_shortcode');

    If you haven’t done that already, the easiest way to do so is within your WordPress dashboard. Under the Appearance menu entry, click Editor. Then, make sure your theme is selected, and find functions.php in the list of files. Then, add the above code to that file. The easiest thing to do is to add it at the bottom.

    If you have already done this, and the shortcode still isn’t working, let me know, and I’ll look into it further.

    Thread Starter DragoWeb

    (@dragoeco)

    It works, I edited the function.php file from the template folder with Notepad++ and added this line at the bottom :
    ‘add_filter(‘widget_text’, ‘do_shortcode’);’
    and everything works fine now.
    Thanks a lot for this great plugin and for you fast answer John ??

    Glad it worked!

    Let me know if you encounter any other issues or have suggestions!

    Just for your information (and anyone else who reads this thread), I released an update to this plugin which adds a widget.

    Now, when editing your sidebar widgets, there will be an additional option (called Ad Blocking Detector). This widget allows you to choose, from a dropdown, which shortcode you want to display and position it on your sidebar.

    The text widget method still works, and it provides some additional flexibility. But, just so you’re aware, there is now another option.

    You can find some screenshots and a short explanation here: https://adblockingdetector.jtmorris.net/new-feature-sidebar-widgets/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Doesn't work on a widget’ is closed to new replies.