So Easy Even a Chimp Can Do It!
RSS icon Email icon Bullet (black)
  • 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!

    Post to Twitter Post to Plurk Plurk This Post Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to StumbleUpon Stumble This Post

  • WordPress Short Codes in Templates

    How do you put shortcodes in your template files?

    I came across a problem the other day.  I found a plugin I wanted to use but it didn’t have any php calls to invoke it, only WordPress shortcodes.  I scanned the forums and found a very good alternative from Dukessa.  By using a WordPress call to the short code  I could add the call to the header.php file.

    Here is the call format:

    <?php echo do_shortcode(’[shortcode]‘); ?>

    Here is an example of how to embed a short code in a header.php file for NextGEN Gallery plugin.

    <?php echo do_shortcode(’[slideshow id=1]‘); ?>

    Give it a try, it works great.

    Post to Twitter Post to Plurk Plurk This Post Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to StumbleUpon Stumble This Post

  • Twitter Twitter Everywhere - Adding Twitter to WordPress Posts

    Twitter Obsession
    I am continuing with my Twitter obsession this week with a new plugin call Tweet This.  This plugin adds a twitter link to each post you create in WordPress.  Here are some of the details:

    Tweet This, a WordPress Plugin for Twitter

    Tweet This, a WordPress Plugin for Twitter
    By Richard X. Thripp at 2008-09-02T00:20:09Z in Technology, with these tags: internet, networking, php, plugins, tweet this, twitter, wordpress, jump to comment form. 2,060 words.

    Click here to download Tweet This v1.3.9

    A plugin that adds a Twitter link to every post and page, so your readers can share your blog entries on their Twitter accounts with ease. Shortens URLs in advance. Tested on WordPress 2.7.1, 2.0.11, and 1.5.
    The Long Description

    Adds a “Tweet This Post” link to every post and page. Shortens URLs in advance through Th8.us, eating up only 19 of 140 characters. Also included: Plurk, Yahoo Buzz, Delicious, Digg, Ping.fm, Reddit, and StumbleUpon. Includes the post’s title after the link (can be customized). If your titles are really long, they get cut off at 136 characters with “…”. Customize under Settings > Tweet This. Includes your choice of six buttons.

    Download Tweet-This

    Installing Tweet This
    This is the standard install in WordPress:
    1. Upload the tweet-this to wp-contents/plugins/
    2. Activate the Plugin (Dashboard/Plugins)
    3. In Settings, Tweet This make any changes

    That’s all you have to do.

    Final Thoughts
    The install was easy and it worked with my default theme, who could ask for more?  Good job to Richard Thripp!

    Also, I have not noticed any slow-down on my page loads like other people have mentioned.

    Post to Twitter Post to Plurk Plurk This Post Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to StumbleUpon Stumble This Post

Bad Behavior has blocked 726 access attempts in the last 7 days.

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.