1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 5.00 out of 5)

Use Shortcodes Everywhere In WordPress

using wordpress shortcodes everywhere

You installed a plugin and then you try to use the shortcode on your sidebar. It does not show up, what do you do? Well here is a series of short codes that you will add to your functions.php file.

By adding the following short codes you will  be able to execute scripts from plugins anywhere in your WordPress CMS.

Enable Short Codes in Sidebars and Text Widgets *

 

add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');

Enable Short Codes in template Files *

 

<?php do_shortcode('[foo]'); ?>

Enable Short Codes in Comments *

 

add_filter( 'comment_text', 'shortcode_unautop');
add_filter( 'comment_text', 'do_shortcode' );

Enable Short Codes in Categories, tags and Archive Pages *

 

add_filter( 'term_description', 'shortcode_unautop');
add_filter( 'term_description', 'do_shortcode' );

These codes will help you use shortcodes everywhere in WordPress. Because of security measures WordPress disables many of them by default.

Please follow and like us:
Use Shortcodes Everywhere In WordPress was last modified: June 2nd, 2016 by Maximus Mccullough

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.