Create a gist now

Instantly share code, notes, and snippets.

Manually Curated Related Posts - Pre-Loop Code
* Related Posts Before Loop
* Adds connection data to $wp_query. Run before the loop.
* @author Bill Erickson
* @link
function be_related_posts_pre_loop() {
// Make Sure plugin is active
if ( !function_exists( 'p2p_register_connection_type' ) )
global $wp_query;
p2p_type( 'related-articles' )->each_connected( $wp_query );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment