Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active October 20, 2015 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/1624373 to your computer and use it in GitHub Desktop.
Save billerickson/1624373 to your computer and use it in GitHub Desktop.
Manually Curated Related Posts - Establish the Connection
<?php
/**
* Related Post Connection
* @author Bill Erickson
* @link http://www.billerickson.net/manually-curated-related-posts/
*
* @uses Posts2Posts
* @link https://github.com/scribu/wp-posts-to-posts/wiki
*/
function be_post_type_connections() {
p2p_register_connection_type( array(
'name' => 'related-articles', // unique name
'from' => 'post',
'to' => 'post',
'title' => array( 'to' => 'All Connections', 'from' => 'Related Articles' )
) );
}
add_action( 'p2p_init', 'be_post_type_connections' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment