Linux, Open Source, Free Software, Bicycles, and other topics of interest.
RSS icon Twitter icon
  • Mastering WordPress Shortcodes

    Posted on February 4th, 2009 linuxandfriends No comments

    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.

    Related Posts

    Comments are closed.