Last active
October 20, 2015 20:55
-
-
Save billerickson/1624373 to your computer and use it in GitHub Desktop.
Manually Curated Related Posts - Establish the Connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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