RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts</strong | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.69% (5.89%*) • Home Loan Fixed: 5.39% (6.59%*) • Fixed: 5.39% (6.59%*) • Variable: 5.69% (5.89%*) • Investment IO: 5.69% (6.48%*) • Investment PI: 5.39% (6.59%*)

Better Permalinks

Linking to another post with a full URL from within your own website is a bad idea. If you change domain name, change the post slug, or just move your website into another directory, your own internal links will be broken. You would then have to go through your entire database and search and replace each and every occurrence of a link.

We use a fairly comprehensive link plugin for our clients that does all sorts of things: links scheduled posts, attaches favicons to outgoing posts, disables broken links, and more. Referencing the permalink means that the link will always be valid... even if you change your domain, URL structure, slug or installation directory.

In its simplest form, you may use the following.

1
<?php 
2
/*
3
 Better Permalinks
4
 http://www.beliefmedia.com/code/wp-snippets/better-permalinks
5
*/
6
 
7
function beliefmedia_permalink($atts, $content = null) {
8
  extract(shortcode_atts(array(
9
    'id' => '',
10
    'title' => ''
11
  ), $atts));
12
 
13
 /* If no link title defined, use title */
14
 $title = ($title == '') ? get_the_title($id) : $title;
15
 
16
 return '<a href="' . get_permalink($id) . '" title="' . $title . '">' . $content . '</a>';
17
}
18
add_shortcode('permalink', 'beliefmedia_permalink');

Usage

Usage is as follows:

[permalink id="1234"]link text in here[/permalink] (where 1234 is the linked post ID). The result is a constructed link.

See also:

Our clients should make contact with us if they're not already using our links plugin.

■ ■ ■

 
Download our complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment