Colors Of Bliss

Creativity in a Nutshell

Enable Shortcodes Api’s on WordPress

To enable a shortcode on a post or a page:
Add the function in the template code,

//[foobar]
function foobar_func( $atts ){
return “foo and bar”;
}
add_shortcode( ‘foobar’, ‘foobar_func’ );

Reference: http://codex.wordpress.org/Shortcode_API

To enable a shortcode on the sidebar text widget you need to add an additional code in themes function.php

Finally add the shortcode [foobar] wherever required.

Reference: http://kb.oboxsites.com/knowledgebase/how-to-enable-shortcodes-in-text-widgets/

Short Code for Displaying Posts of specific Category

Refer: http://www.wprecipes.com/wordpress-shortcode-display-the-loop

Leave a comment

Information

This entry was posted on March 19, 2013 by in My Tech References, Wordpress.