-
More WordPress Short Codes - Mastering The Short Code
Mastering ShortCodes
Here is a great article from Smashing Magazine on WordPress Shortcodes. I didn’t ever think of setting up custom shortcodes.1. Open the functions.php file in your theme. If the file doesn’t exists, create it.
2. First, we have to create a function to return the “Hello World” string. Paste this in your functions.php file:
function hello() {
return ‘Hello, World!’;
}
3. Now that we have a function, we have to turn it into a shortcode. Thanks to the add_shortcode() function, this is very easy to do. Paste this line after our hello() function, then save and close the functions.php file:
add_shortcode(’hw’, ‘hello’);The first parameter is the shortcode name, and the second is the function to be called.
4. Now that the shortcode is created, we can use it in blog posts and on pages. To use it, simply switch the editor to HTML mode and type the following:
[hw]You’re done! Of course, this is a very basic shortcode, but it is a good example of how easy it is to create one.
There are steps for adding your own shortcodes for twitter, rss readers, subscribe to rss, adsense, and wordpress database lookups.
Here is another example of a shortcode for downloading a file. This has all the instructions to create the plugin and use the short code in your posts:
Using Wordpress Shortcode To Create Beautiful Download Boxes
Since shortcode was introduced in Wordpress 2.5 it’s been possible to do many cool things. Everything from simple donate buttons to more advance things. In this article I will show you a simple but efficient way to create one of those download-boxes that I and many other use on their blogs.Remember if you are creating shortcodes you need to add them to the functions.php file. If you are upgrading your system automatically you will want to keep a copy of all your new shortcodes and add them back to the updated files. If you don’t they could stop working at some point (when functions.php is replaced).
Enjoy!
Plurk This Post
Digg This Post
Ping This Post
Stumble This Post -
WordPress on AutoPilot - Free Pocket Guide
WordPress on AutoPilot Mini Guide
I have just posted a mini guide on WimpyGuides.com with all the plugins from the my ebook WordPress on AutoPilot: Getting Your Blog to Automatically Find Content, Traffic, and Sales.It is a pocketmod you can print on one page of paper and keep with you. All the plugins are listed to get a WordPress AutoPilot site up and running using WordPress and free plugins.
Here are the details about the mini guide:
Here is a FREE pocket guide based on the WordPress on AutoPilot ebook. Print a copy of this and keep it in your pocket. The next time you have have to install WordPress you will have a list of all the plugins you will need to run the site on AutoPilot.
Click here to download - 2009 WordPress on AutoPilot MiniGuide
What does it mean to be on AutoPilot?
It means you can automate a majority of your blogging tasks and save up to 90% of your time.Any Suggestions?
Are there any other plugins or features that I should add to this mini guide?
Plurk This Post
Digg This Post
Ping This Post
Stumble This Post
Bad Behavior has blocked 697 access attempts in the last 7 days.
Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.


