Please, anyone can help me how to show attachments connected with post.
I know that there are specific query functions in WP to achieve similar goal but I want a curated list of related images.
I have already registered a connection type with p2p_register_connection_type
hooked in wp_loaded
and created some connections between posts and some attachments.
p2p_register_connection_type( array(
'name' => 'attachment_to_post',
'from' => 'attachment',
'to' => 'post',
'title' => 'Parceiros relacionados'
) );
Now how I query these connections in single post template?
I tried using the function get_posts()
and also create a new WP_Query
object as shown in basic usage wiki https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage.
I also tried using get_connected()
but not returns connected attachments when I print_r()
query object.
I’ve read the Wiki, tried to look at the code, I’ve tried so many things that it is difficult to list here.
Any help will be appreciated.
http://wordpress.org/extend/plugins/posts-to-posts/