开发者 | docofmedia |
---|---|
更新时间 | 2015年5月13日 22:06 |
捐献地址: | 去捐款 |
PHP版本: | 2.5 及以上 |
WordPress版本: | 4.2.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
the_full_shortn_url
will output just the full URL, without any formatting, which can be used in various Twitter or other microblogging plugins. the_shortn_url_link
will output an HTML link using the configuration from Shortn.It's options page.
Available Template Tags
the_shortn_url_link()
outputs an anchor (a) tag, ex: <a href="http://docof.me/shortn-it" class="shortn_it" rel="nofollow" title="shortened permalink for this page">http://docof.me/shortn-it</a>
get_the_shortn_url_link()
retrieves the above anchor for storage in a variablethe_full_shortn_url()
outputs the short URL, ex: http://docof.me/shortn-it
get_the_full_shortn_url()
retrieves the above URL for storage in a variablethe_shortn_url()
outputs the short URL without the domain, ex: shortn-it
get_the_shortn_url()
retrieves the above URL for storage in a variableshortn-it
folder to the /wp-content/plugins/
directory<?php the_shortn_url_link(); ?>
in your template where you'd like the shortened URL link to show up or retrieve it using <?php $link = get_the_shortn_url_link(); ?>
. If you only need to retrieve the link address, use <?php $url = get_the_full_shortn_url(); ?>
or <?php the_full_shortn_url(); ?>
to output it directly.A great tool to help you come up with a short domain and see what's available is Domai.nr.
The short domain needs to be configured as an alias to your main domain. If you're not sure how to configure an alias domain, a guide can be found in the help and documentation.