Your Ad Here

Thursday, February 5, 2009

Mastering WordPress Shortcodes

Introduced in WordPress 2.5, shortcodes are powerful but still yet quite unknown WordPress functions. Imagine you could just type "adsense" to display an AdSense ad or "post_count" to instantly find out the number of posts on your blog. WordPress shortcodes can do this and more and will definitely make your blogging life easier. In this article, we'll show you how to create and use shortcodes, as well as provide killer ready-to-use WordPress shortcodes that will enhance your blogging experience.


WordPress Shortcodes



Using shortcodes is very easy. To use one, create a new post (or edit an existing one), switch the editor to HTML mode and type a shortcode in brackets, such as [showcase]. It is also possible to use attributes with shortcodes. A shortcode with attributes would look something like [showcase id="5"]. Shortcodes can also embed content, as shown here: [url href="http://www.smashingmagazine.com"]Smashing Magazine[/url]. Shortcodes are handled by a set of functions introduced in WordPress 2.5 called the Shortcode API. When a post is saved, its content is parsed, and the shortcode API automatically transforms the shortcodes to perform the function they�re intended to perform.



Read More...

[Source: Smashing Magazine - Posted by Kishore Vengala]
Your Ad Here

No comments: