BACK TO DIRECTORY

Post Link Shortcodes

by Evan Mattson

5.0
(2 ratings)

This plugin dynamically adds a collection of helpful shortcodes for each registered post type. These shortcodes can be used to return URLs, or generate HTML elements like anchors and images to the related post!

Each post type will have 2 shortcodes created for it where {type} is the name of the post type. Eg: post or page

[{type}_url]
[{type}_link]

If the post type was registered with has_archive, two more shortcodes will also be created:

[{type}_archive_url]
[{type}_archive_link]

NEW in 0.4.0:
If the post type supports thumbnail (featured images) two more shortcodes will also be created:
[{type}_src]
[{type}_img]

NEW in 0.4.0:
Attachment shortcodes
[attachment_src]
[attachment_img]

[post_src hello-world]
[post_img hello-world size=medium]

For more information and examples: Read the Documentation

More

Post Link Shortcodes on GitHub!

Screenshots

Basic usage. Source shortcode, with html-escaped output in blue.

Basic usage. Source shortcode, with html-escaped output in blue.

Post thumbnail usage.  Works for any post type which supports post thumbnails as well as attachments. Source shortcode, with html-escaped output in blue.

Post thumbnail usage. Works for any post type which supports post thumbnails as well as attachments. Source shortcode, with html-escaped output in blue.

Attachment examples. Source shortcode, with html-escaped output in blue.

Attachment examples. Source shortcode, with html-escaped output in blue.

Plugin Details

Active Installs
40
Total Downloads
3,726
Version
0.4.1
Requires WP
3.6
Requires PHP
Tested Up To
5.2.26
Added
2013-08-27
Last Updated
2019-10-19 6:28pm GMT

Ratings

5
2
4
0
3
0
2
0
1
0