Easily reference another post in your blog using a shortcut, either by id or post slug. The shortcut is replaced with the hyperlinked title of the referenced post.
There are two type of post-to-post links you can do.
- By post ID: e.g.
24is the ID of the post being referenced.
- By post slug: e.g.
hello-worldis the slug/post-name of the post being referenced.
By default the plugin creates a quicktag button by the name of «post link» which, when pressed inserts
<!--post=""--> at the current cursor position in the post content input field; you must supply either the ID or the post slug for the post you intend to reference.
You can disable the quicktag button from being created by changing the value of the setting
The hyperlinked post title of the referenced post that is put in place of the shortcut is by default prepended and appended with double-quotes. You can reconfigure what text is prepended and what text is appended to the hyperlinked title by modifying appropriate values in the configuration section of the plugin file.
NOTE: An incorrect substitution will take place if you happen to have a post with a numerical title (and thus a numerical post slug). So if you have a post titled «22», and you attempt
<!--post="22"-->, the plugin will link to the post with the ID of 22, which is likely not the one titled 22. In such a case, you would need to reference that post’s ID.
- Download the file post-to-post-links.zip and unzip it into your /wp-content/plugins/ directory.
Copy and paste the the code ( post-to-post-links.phps ) into a file called post-to-post-links.php, and put that file into your /wp-content/plugins/ directory. Please ensure you do not introduce any spaces or other characters before the <?php or after the ?>
- Optional: Change configuration options in the file to your liking. In-code comments should help you there.
- Activate the plugin from your WordPress admin ‘Plugins’ page.
function c2c_post_to_post_link ( $text )
- $text : Text to be scanned for shortcut links to posts
(See notes section above)
- 23 Mar 2005 : v0.9 — Released to the public
Copyright (c) 2005 by Scott Reilly (aka coffee2code)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.