preloader LOADING

42Works Blog

Posted on February 18, 2020

WordPress 101: Tips, Tricks & Hacks

WordPress has a lot of features on offer for its users. It is this combustibility that makes WordPress such a popular Content Management System for seasoned developers and newbies alike. WordPress’s ability to adapt to new development requirements is unparalleled when compared to other Content Management Systems in the market. 

WordPress is the first choice of many developers and website owners when they want to build dynamic websites. A dynamic website is one where you aren’t bound by stagnant design elements. In a dynamic website, the site’s functionality is empowered by fluid design elements. 

One of the most essential aspects of a dynamic website is fluid design elements like content areas that have integrated contact forms, tables, etc. To enable such dynamic design elements, a WordPress website uses Shortcodes.

How To Enable Shortcodes In Widgets?

Shortcodes are website elements that allow you to integrate additional features inside your post content area. For example the blog section on your website. Shortcodes can also be used to add dynamic elements to your website sidebar and other widget areas. Businesses can greatly benefit from shortcodes as they add additional features to your website and make your content more functional. 

To add shortcodes to your widget area you would need to jump through a lot of hoops. But worry not, as we have brought to you a quick hack to get things done in an instant! WordPress by default prohibits the execution of shortcodes on custom HTML widgets. This can be bad as developers/website owners may want to add HTML code to your customized widgets on your WordPress website.  

Now to enable shortcodes on your WordPress widgets you need to follow the following hack: 

Step 1 – Open your functions.php file and add the below code to it: 

define('widget_text', 'do_shortcode');

Step 2 – Save your functions file with the edits made. 

 


Leave a Comment:

Your email address will not be published.

para glider
Have a Project ?
We are just as excited

Contact Us

about your Idea
My name is
& I'm interested in discussing about
for my project
. You can email me at
or ring me up at
.

Virginia United States 34.231.21.160 https://42works.net/tech-hacks/enable-shortcuts-on-widgets-in-wordpress