Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #7028

    Hello, I am trying to add shortcode into my sidebar using a text widget for a simple button plugin.

    I have followed the steps outlined in this post, but nothing has worked so far :

    The button shows up, but it is stripped of most of it’s styling.

    Any ideas? So far I have test buttons encoded into my sidebar.php as a workaround, but they ignore the stylesheet and dont adhere to the framework of the page/sidebar as if they were properly used in a text widget. This poses headache upon headache as formatting for the page is now a complete chore.

    Also- in the functions.php there is no ?> closing tag. Why?





    add following code to functions.php (i.e. at the very bottom):

    add_filter('widget_text', 'do_shortcode');

    The ?> is not required at the end of the file that’s why Kriesi skips it.


    I am having a similar issue and have added the following code to my functions.php:

    add_filter(‘widget_text’, ‘do_shortcode’);

    add_filter( ‘widget_text’, ‘shortcode_unautop’);

    After adding this, I can see the button created by the shortcode but I don’t see the styling.




    Can you post a link to your website please?

    Best regards,



    Sure – do you have an email address I can send it to? It is behind a password right now as it is not live yet.



    You can send the mail to (Email address hidden if logged out)



Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Adding shortcode into sidebar’ is closed to new replies.