Use Shortcodes Everywhere In WordPress

Subscribe

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

 

[code]<?php do_shortcode(‘[foo]’); ?>[/code]

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.

Use Shortcodes Everywhere In WordPress was last modified: June 2nd, 2016 by Maximus Mccullough

using wordpress shortcodes everywhere

Leave a Reply

Your email address will not be published.

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