Ethan Shaw
Member
Posted 1 year ago #
Hi Scribu,
Thank you for such an awesome plugin. I have come to use it in every project I do now. :)
I have read through your site, the wiki and the source files for Posts 2 Posts but I cannot figure how to count the number of connections? I tried using php's count function and wp_count_posts in varying combinations but to no avail.
Do you have any thoughts?
Thank you so much for your time!
http://wordpress.org/extend/plugins/posts-to-posts/
WP_Query actually has a variable for this:
$connected = new WP_Query( array(
'post_type' => 'page',
'connected_from' => $post->ID
) );
echo $connected->found_posts;
That will output the total number of connected posts found.
Ethan Shaw
Member
Posted 1 year ago #
Thank you for considering programming it in!
I didn't do anything. It comes from WordPress. :)