Add Style to Text with WordPress Shortcode

and like us on FB

The following shortcode is a handy function that will allow you to add text styling using a BBcode (shortcode) style of syntax. You’ll easily be able to add CSS styles within your post. Example: [format style=”font-size:1.5em;color:#f00;”]Important![/format].

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.