Skip to content

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().