• By the way, what a great plugin bro, scribu! It’s really useful when it comes to relating posts. This should be put in the WordPress core.

    Connection between custom post type and attachment.

    Is this possible? I’ve tried to connect my custom post type named “person” to “attachment”. I wasn’t able to see the box in the attachment.

    The idea was to connect custom post type “person” to “attachment”.
    Why? – I want to connect it, because I want to add connection who is in the photo like for example.

    Example:
    I uploaded a photo in attachment. – People who are in the photo are Person A, Person B and Person C. Connecting it from “person” to “attachment”.

    Additional Question: Bro, can Post 2 Post plugin handle 10,000 posts with 100,000+ more connections? (If you have a good server though.)

    Thanks and God Bless!

    http://ww.wp.xz.cn/extend/plugins/posts-to-posts/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author scribu

    (@scribu)

    I can definitely see how using P2P for attachments would be useful, given that an attachment can only have one parent.

    Is this possible? I’ve tried to connect my custom post type named “person” to “attachment”. I wasn’t able to see the box in the attachment.

    It’s possible, but you’ll only see the box when editing a ‘person’ post type. See https://github.com/scribu/wp-posts-to-posts/issues/36

    Can Post 2 Post plugin handle 10,000 posts with 100,000+ more connections? (If you have a good server though.)

    Yep; see https://github.com/scribu/wp-posts-to-posts/wiki/Data-organization

    Thread Starter letusrise

    (@letusrise)

    Wow, cool. Thanks so much for your immediate response!

    Bro, can I have another question?

    $thequerydirector = new WP_Query( array(
       'post_type' => 'person',
       'connected' => $post->ID,
       'connected_meta' => array(
         'role_type' => 'director' )
       )
      );
      echo '<ul>';
      echo '<li><strong>Director:</strong> ';
      while( $thequerydirector->have_posts() ) : $thequerydirector->the_post();
       $permalink = get_permalink();
       $thetitle = get_the_title();
       $directors = '<a href="' . $permalink . '">' . $thetitle . '</a>';
       $wdirectors =  '<a href="' . $permalink . '">' . $thetitle . '</a>';
    
       echo $wdirectors;
    
      endwhile;
       echo '</li>';
      wp_reset_query();

    Is there a better way of improving this? Also, I want it to do like “foreach” because I want to add comma to each custom post type “person” connected as director.

    Like for example.

    Directors: Person A, Person B, Person C

    Thanks and God Bless!

    Plugin Author scribu

    (@scribu)

    https://github.com/scribu/wp-posts-to-posts/wiki/Looping-The-Loop

    Please read all the tutorials in the wiki before asking any more questions, ok?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Posts 2 Posts] Connection between custom post type and attachment.’ is closed to new replies.