All Collections
WordPress
WordPress: Can I use shortcodes to create widgets?
WordPress: Can I use shortcodes to create widgets?

Learn how to add buttons to your website with shortcodes

João Romão avatar
Written by João Romão
Updated over a week ago

Good news: yes you can. But it needs a little tweak. You can add share buttons to the sidebar by using our shortcodes. However, you must first allow your website to read shortcodes on widgets.

Step 1: Allow shortcodes on widgets.

To enable this functionality, you only need to add a new filter hook into your theme's functions.php file. If you have the ability to do so, open up the functions.php file in your theme directory and add the following line to the top (after any comments) or bottom of the file:

add_filter('widget_text', 'do_shortcode');

This quick video might help you:

Step 2: Add shortcode to widget

The next step is to go to the widget area and add a new Text/HTML widget. There, you'll be able to introduce one or more short codes provided by GetSocial. 

This video can also help understand how to do it:

Here's a list of the Shortcodes that are available:

  • Horizontal Share Bar:

[getsocial app="sharing_bar"]
  • Horizontal Follow Bar:

[getsocial app="follow_bar"]
  • Original Share Bar:

[getsocial app="native_bar"]
  • Custom Facebook Actions:

[getsocial app="custom_actions"]
  • Total Horizontal Share Bar:

[getsocial app="social_bar_big_counter"]
  • Reaction Buttons:

[getsocial app="reaction_buttons"]

Don't forget that you have to activate the app on your dashboard and choose the social networks you want it to show.

And that's it. You're ready to go!

If something is not working as expected, send us a message to support@getsocial.io or through our in-app chat.

Did this answer your question?