Advantages & Uses of WordPress Text Widgets – Building a blog or website with WordPress, we all have to agree that Widgets are a facility that we really need to make our blog stronger, have more functionality and look more attractive. And among all those widgets, one of my favorites is Text Widget or text widget. It is also one of the most used WordPress widgets by WordPress users.
In this WordPress tutorial article, I will show you all the main functions you can perform with a text widget.
1. Use HTML
Thanks to HTML, the Text widget allows you to do many things like:
Add Audio or Video
So, you want to have audio and video playing on your site? Since the text widget supports HTML, you only need to copy and paste the embed code from Audio and Video and adjust the code to make it look good on your site.
- Visit sites like Youtube or SoundCloud
- Select the audio or video you want to display
- Look for the embed code or iFrame code
- Copy and paste it into the Text Widget
- Adjust the dimensions or sizes you want
Adding Words or Links
You can create site introduction, Information about us, welcome words / messages and so on with or without a link by adding a sentence directly to the widget. With the help of HTML, you can add effects to your text such as font size, color and so on. And in fact, it’s very easy to put code into use Google AdSense without certain problems and settings, where AdSense ads will immediately appear properly when placed in Widget Text.
Apart from video or audio, you can also add images to the Text widget. Similar to video and audio, you will need to use HTML to add images, so if you already have the URL of your image, you can just enter the url by adding the html code to display the image.
2. Use a shortcode
You can use the shortcode for the Text widget. Shortcodes Introduced in WordPress 2.5, shortcodes are useful and allow you to create custom content.
Of course, we can’t just use the shortcode for the widget, because the shortcode is not the default WordPress, but no one can still use it in the following way so that the widget text can support it:
There are 2 ways you can do this:
1. You can do this manually by opening the WordPress theme’s functions.php file you are using and adding the following code.
It only allows you to use the shortcode for Text widgets, does not apply to other widgets.
2. You can do it another way by using a plugin
Here are good plugins that I recommend: shortcodes Everywhere.
Installed plugins and shortcodes are ready to be used inside widgets, comments, experts, categories, tags and taxonomy descriptions.
Add the Widget Text shortcode
The hard part is done, and now you can freely use the shortcode for the Text widget. For illustration, I’m going to use the Gallery shortcode to display the gallery using the Text widget:
- Upload your image for gallery
- Drag and drop the Text widget onto your sidebar
- Enter the gallery shortcode into the Text widget
And see the results: