‘Shortcodes’ are a feature of wordpress used for executing custom functions by inserting a small snippit of code into a post. For example, my download monitor plugin now uses shortcodes; by entering [
download id="1"] into a post, the plugin will output a download link.
The shortcode syntax varies, here are some examples:
Shortcodes can be created to perform a handful of useful functions. To use any of the shortcodes in this post I recommend adding the functions to your functions.php theme file (create it if it does not exist!). Ill show shortcodes ranging from showing adsense to speaking pirate! (written for wordpress 2.7)
If you have ever tried to include code in a wordpress post you may have gone through hell trying to get it to output correctly; WordPress’ built in functions for formatting text (autop and texturize) mangle your code making it non-functional.
I’ve tried many solutions in the past, such as disabling wordpress’ formatting functions, however, this is not ideal -especially if you rely on them to clean up your text and properly encode characters. On top of that its not even valid to include certain things such as CSS in the body of a xHTML document.
The solution? Custom fields. This post will show you how.
As promised last week, this week we are looking at fetching RSS feeds with Magpie RSS.
Magpie is an PHP based RSS feed parser; I.E. It fetches RSS feeds to display in other places, which gives it many uses.
Unknown to many, wordpress has the magpie RSS parser built in, this article will teach you how to use it, and also how to fetch and show someones del.icio.us bookmarks!
In this first edition of “WordPress development techniques” I will be talking about one of the most useful classes available for use in wordpress: wpdb.
The wpdb class (WordPress DataBase class) is based on the ezSQL class, and handles database connections and queries.
Why use it? You can make all sorts of custom queries, and pull information from the wordpress database, including posts! Read on for more information on this useful class…