Sillybean

WordPress Hidden Gems: the_shortlink() and the default permalink structure

There’s a new function in WordPress 3.0, the_shortlink(). You can place this in your single.php theme file to print a shorter URL for the current post if your permalink structure results in something very long.

The Permalinks Settings screen

The WordPress.com Stats plugin's options screen

If you have the WordPress.com Stats plugin installed, you’ll get short links using the wp.me service. However, if you’d prefer to use your own domain, just turn the wp.me links off in the plugin’s settings (under Plugins → WordPress.com Stats). WordPress will begin using your default permalink structure instead (unless you have yet another plugin that’s altering your shortlinks). The default structure always works, even if you’ve chosen one of the longer ones.

Find all the WordPress Hidden Gems in Beginning WordPress 3.

Posted on September 16, 2010 at 10:59 am in WordPress · comment
Part of the series

Sharing this post? The short URL is: http://sillybean.net/?p=6248

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>