Considering how regularly new versions of Firefox now come along, that's quite some bug fix list in version 10! http://t.co/K3I2vLpW 1 week ago


23rd
Feb 11

WordPress function get_the_shortlink



Many WordPress functions have a standard version which outputs the results directly and an additional version prefixed with get_ that returns the output – useful for adding to a string and manipulating before output.

One such exclusion is the_shortlink, which returns a short link to any page or post – there is no get_the_shortlink, so many people have to resort to just outputting the result in a FORM field for people to cut & paste.  However, here is a quick way to add the capability to your blog – simply add the following 5 lines to your theme’s function.php file…

function get_the_shortlink() {
    $post_id = get_the_ID();
    if ($post_id!="") {$shortlink=home_url()."/?p=".$post_id;} else {$shortlink="";}
    return $shortlink;
}

Or, in one line…

function get_the_shortlink() {if (get_the_ID()!="") {return home_url()."/?p=".get_the_ID();} else {return;}}

Now you just need to call get_the_shortlink() from within your WordPress loop and it will return the shortlink URL.

Unlike the_shortlink it doesn’t accept any parameters, but this is a quick and simple solution.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



22nd
Feb 11

WP README Parser WordPress Plugin Updated


WP README Parser version 1.1 has been released with the following changes…

  • Improved code display – particularly code multi-lines
  • Fixed a file fetching bug
  • Added a new option to suppress specific lines of output

Full details, including a download link, are available on the plugin page.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly



21st
Feb 11

WP Relative Date – new WordPress plugin


Today I’ve launched a new WordPress plugin – WP Relative Date.

This provides a much needed improvements to WordPress’ ability to display relative dates (e.g. “This post was added 4 days ago.”) A simple change to your theme code and you can benefit from improved levels of reporting (WordPress, for instance, only shows a maximum of months, hence a post that is a number of years old will display as a large number of months instead).

I wrote this as part of the recent site re-vamp and initially included the functionality within my functions.php file. In the end I converted it to a separate plugin, however, and updated it to be of release quality.

More details and download instructions are on the plugin’s dedicated page.

Delicious Digg Facebook LinkedIn Read It Later reddit StumbleUpon Twitter SeparatorEmail Google Translate PDF Online Print Friendly