Category: Development

  • WordPress Plugin Developer Day

    Today is WordPress Plugin Developer Day.

    The idea is to give back to those who provide useful, free plugins for WordPress.

    What they’re asking is that anyone that has ever gotten even the slightest benefit from a WordPress plugin to say thank you today by making a small donation to the plugin/developer of your choice.

    Yes, I’m one of those people, but this blog is also enhanced thanks to the plugins for others so I’ll be donating as well.

    Hopefully this will make you feel as good as it does me – they deserve our gratitude.

  • WordPress for Android

    WordPress have announced the release of the WordPress for Android App.

    According to WordPress…

    The initial release has focused on giving you the ability to manage your blog while on the go.

    Features include the ability to:

    • Configure and manage multiple blogs
    • Comment moderation including the ability to reply to comments
    • Create and Edit Posts including categories, tags and photos
    • Create and Edit Pages
    • Get notified of new comments in the Android notification bar

    I was using wpToGo, which had a more restricted set of abilities, but this taken over by WordPress and modified to this new plugin. I replaced it last night and, indeed, it is a much better and powerful tool, allowing me to view my posts and create new ones (amongst many other things) in a very easy fashion.

    If you administer a WordPress blog, this is highly recommended.

  • Displaying WordPress short codes

    I’m in the process of writing some instructions for a new plugin – one which uses WordPress short codes. They’re the useful codes that you put in square brackets and are replaced by something else.

    The problem is then documenting, because your plugin then wants to convert your text to the appropriate output.

    Thankfully, my solution is quick and simple – and it involves another short code!

    Open up your themes function.php file and add the following lines of code to it…

    add_shortcode('showme',show_me');
    function show_me($paras="",$content="") {return $content;}

    Then, simply wrap [showme] and [/showme] around any short codes that you don’t want to be interpreted but do want to be displayed.

  • WordPress 2.9 and my pages!

    I updated to WordPress 2.9 yesterday. All appeared fine.

    That is, until I went to update a page today and found the Edit button didn’t work any more. Neither was the URL shortening for the page. And then I noticed that all the comments were missing.

    It appeared that the URL for the page was not being returned correctly. At first I thought this to be a potential WordPress fault but after installing the default page.php into my theme it worked! So I’m slowly converting my pages using them default theme page as a template. So, bear with me as it will take a while to do this (work, Christmas, etc, all getting in the way!).

    It’s strange that I haven’t found any reference to any of this functionality being changed…

    Update

    I found the fault. It was this line…

    if (function_exists('simple_social_bookmarks'))

     
    ..which I use to detect if the current user has editing rights – if so, the edit option is displayed. I’ve now modified the edit_post_link parameter to do this instead.

    No mention of this being changed in this way in any of the documentation and it works fine with posts. Weird.

  • Add Twitter links to your WordPress posts

    Want an easier way to add links to Twitter user pages? Here’s a quick solution.

    Add the following code to your functions.php file within your theme folder…

    add_filter('the_content', 'link_to_twitter');
    function link_to_twitter($content) {
        $start=strpos($content,"[@");
        while ($start!=0) {
            $code=substr($content,$start+2,strpos($content,"]",$start)-$start-2);
            $content=str_replace("[@".$code."]",'<a href="http://twitter.com/'.$code.'" target="_blank">@'.$code.'</a>',$content);
            $start=strpos($content,"[@",$end);
        }
        return $content;
    }

    Now, you simply need to simply specify a Twitter username within square brackets and it will be replaced with the same username, but now with a link to Twitter.

    For example, add [@dartiss] to your post and it will display as @dartiss.