Hi Scribu,
I’m having a similar problem, and I’m going nuts here. This should be pretty simple but can’t get it to work.
I have this setup in my functions.php
function my_connection_types() {
if ( !function_exists( 'p2p_register_connection_type' ) )
return;
p2p_register_connection_type( array(
'from' => 'promocion',
'to' => 'post'
) );
}
add_action( 'init', 'my_connection_types', 100 );
And now I’m trying to get promotions connected to posts that are archived under category ‘4’ for example.
$promotions = get_posts( array(
'post_type' => 'promotion',
'nopaging' => true,
'orderby' => 'ID',
'each_connected' => array(
'post_type' => 'post',
'nopaging' => true,
'cat' => '4'
),
'suppress_filters' => false
) );
Is this possible? Thanks in advance