Support » Plugin: Posts 2 Posts » View connections in template

  • fued10

    (@fued10)


    Hi Guys,
    Is it possible to list the connections on another template (not a single or archive page)? For example I have a Contact page and in this page I want to list Staff that work in an office.
    My connection is

    p2p_register_connection_type(array(
    			'name' => 'staff_to_office',
    			'from' => 'staff',
    			'to' => 'office'
    		));

    In mysql what I’d like to achieve will look like this
    SELECT * FROM staff WHERE office_id = 123

    I would like to pull out all the information in this manner using WP_Query (on the same page)

    London
    ——
    John Smith
    Steve Jones

    New York
    ——–
    John Doe
    Jane Done

    Paris
    —–
    John Doe
    Steve Jones

    Any help will be greatly appreciated

    Thanks

    https://wordpress.org/plugins/posts-to-posts/

  • The topic ‘View connections in template’ is closed to new replies.