Related posts

scribu edited this page Apr 28, 2012 · 15 revisions

Continuing from the Basic usage tutorial, let's say that when viewing a single post, you don't want to show the connected page, but other posts connected to the same page:

$related = p2p_type( 'posts_to_pages' )->get_related( get_queried_object() );

The only difference is that we replaced get_connected() with get_related().

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.