WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Simple Short Links

Adjust the WordPress shortlinks format with an extra settings page.

Theme

Current documentation should be found at Function Reference/the shortlink

Here is a basic reference for the template functions provided by Simple Short Links. WordPress 3.0+ users, see also wp-includes/link-template.php for more details about the_shortlink().

/**
 * Template Tag for Displaying the Short Link
 *
 * Must be called from inside "The Loop"
 *
 * Call like <?php the_shortlink(__('Shortlinkage FTW')); ?>
 *
 * @since 1.1
 * @param string $text Optional The link text or HTML to be displayed.  Defaults to 'This is the short link.'
 * @param string $title Optional The tooltip for the link.  Must be sanitized.  Defaults to the sanitized post title.
 */
function the_shortlink($text = '', $title = '');

A second, similar tag is now available in case you need to display a self-referring short link on a category page.

/**
 * Template Tag for Displaying the Short Link for a Category
 *
 * Should be called from outside "The Loop"
 *
 * Call like <? the_single_shortlink(__('Shortlinkage FTW')); ?>
 *
 * @since 1.3
 * @param string $text Optional The link text or HTML to be displayed.  Defaults to 'This is the short link.'
 * @param string $title Optional The tooltip for the link.  Must be sanitized.  Defaults to the sanitized category name.
 */
function the_single_shortlink($text = '', $title = '');

The CSS Printing Trick

Try adding something like this to your theme's CSS file to make the URL for the short link appear when printed.

@media print {
 .shortlink a:link:after {
    content: " " attr(href);
 }
}

The CSS example assumes the_shortlink() is used inside of a DIV or P element with a class attribute called "shortlink".

Requires: 3.0 or higher
Compatible up to: 3.9.2
Last Updated: 2014-4-10
Downloads: 3,963

Ratings

4 stars
4 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1
100,1,1 100,1,1 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1 100,1,1
100,1,1
100,1,1
100,1,1
50,2,1 100,1,1 100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
0,1,0
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1