Skip to content

Shortcodes

scribu edited this page Sep 16, 2012 · 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.

Examples:

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]

The inline mode was introduced in version 1.4.3-alpha.