Mastering WordPress Shortcodes
What are WordPress shortcodes?
These are small snippets of code which you can embed in your WordPress post. And when you publish your post, WordPress will expand them to the corresponding HTML/XHTML code.
For example, in a blog hosted by WordPress.com, you can easily embed YouTube videos using the [
youtube=URL] shortcode. Where the URL is something like
http://www.youtube.com/watch?v=AgEmZ39EtFk. This will embed the corresponding YouTube video into your post. You will never have to mess with the embed tags required to insert a video into your post. In fact creating your own custom WordPress shortcodes is childsplay if you know a bit of PHP.
SmashingMagazine.com has a wonderful writeup on steps required to create your own custom shortcodes for your WordPress blog. The article is quite exhaustive and provides a number of examples such as “Creating a Subscribe to RSS” shortcode, “Google Adsense” shortcode, “Embedding an RSS reader” shortcode, and so on.