Skip to content

Shortcodes

scribu edited this page Mar 13, 2013 · 6 revisions

The plugin comes with two shortcodes, which you can insert inside the post content.

p2p_connected

The [p2p_connected] shortcode will show a list of items connected to the current post.

Just insert one of the following examples into your post content:

Unordered list:
[p2p_connected type=posts_to_pages]
Ordered list:
[p2p_connected type=posts_to_pages mode=ol]
Comma-separated list: [p2p_connected type=posts_to_pages mode=inline]

The type parameter represents the name of the connection type you'd like it to use.

p2p_related

The [p2p_related] shortcode will show a list of items related to the current post.

Example:

Ordered list:
[p2p_related type=posts_to_pages mode=ol]

For changing the output of a shortcode, see Actions and filters.