• Resolved kcomphlint

    (@kcomphlint)


    We would like to have the ability to supply an “if” argument in our template file so that if the page or post being viewed is related to another specific page or post, then that if argument would be triggered.

    For instance, we have a “people” post type. We have them connected to multiple pages of a “services” post type. If they are connected to service #2, then a certain piece of code would be written into the template file. If not, then it doesn’t get executed.

    http://wordpress.org/extend/plugins/posts-to-posts/

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

    (@scribu)

    Thread Starter kcomphlint

    (@kcomphlint)

    Thanks!

    So in that code, what goes in place of the $post_a and $post_b? Should that be the ID of the post we are looking at (post_ID) and the value of the post we want to check for “123”?

    Here is our connection type setup in the functions file:

    p2p_register_connection_type( array(
    		'name' => 'related_attorneys_services',
    		'from' => 'people',
    		'to' => 'services',
    		'title' => array( 'from' => 'Related Services & Industries', 'to' => 'Related Attorneys' )
    	) );

    We want to check that the “people” are related to a specific post under “services”.

    Thanks!

    Plugin Author scribu

    (@scribu)

    $post_a and $post_b can be either post IDs or post objects. Post objects is preferred.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Posts 2 Posts] Query Connection For Specific Relationship’ is closed to new replies.