As a developer, I’ve always found permalinks and directory structures between local, staging, and production environments to be a pain. Creating links within content requires either absolute (
http://yourdomain.com/path/to/post/) or a non-domain-specific absolute (/install/directory/path/to/post) URLs.
This can prove to be a pain during the development or migration process. It can also make it annoying if you happen to change your permalink structure and have tons of posts.
Introducing dynamically inserted WordPress permalinks with The Permalinker
How it works:
[permalink]This is a link to the current post
Linking to a different post:
You can set the
id attribute in the short code to point to a specific page/post:
Supported anchor attributes:
[permalink id=23 class="my_class" rel="self" target="_blank"]Open post 23 in a new window
Want more control over your markup?
Using a non-terminating or empty
http://theandystratton.com/2009/the-permalinker-wordpress-plugin-dynamic-permalinks short code will simply output the permalink URL:
<a href="http://theandystratton.com/2009/9-revision-3" class="thickbox" id="link_23">Another link to page/post 23</a>
There’s more: Dynamically grab your template directory
As a request from fellow WordPress designers and developers, I’ve included a
http://theandystratton.com/wp-content/themes/theandystratton short code as well, allowing you to quickly and dynamically get the full URL to your active template directory from the content editor:
<img src="http://theandystratton.com/wp-content/themes/theandystratton/photos/yoda.gif" alt="A picture of Yoda!" />
You can learn more and download The Permalinker from the WordPress plugin repository.
Happy coding ;]