WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
View connections in template (1 post)

  1. fued10
    Member
    Posted 5 months ago #

    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/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.