WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Posts 2 Posts] Page with more than one parent

[Plugin: Posts 2 Posts] Page with more than one parent

Viewing 5 replies - 1 through 5 (of 5 total)
  • Rhand
    Participant

    @rhand

    I can create page to page connections using

    function my_connection_types() {
    	// Make sure the Posts 2 Posts plugin is active.
    	if ( !function_exists( 'p2p_register_connection_type' ) )
    		return;
    
    	p2p_register_connection_type( array(
    		'name' => 'pages_to_pages',
    		'from' => 'page',
    		'to' => 'page'
    	) );
    }
    add_action( 'wp_loaded', 'my_connection_types' );

    It creates two sidebar boxes in the page editor: from pages and to pages. What I wonder about here is A)Does this mean I can now load permalinks with different page parents for ONE child or how can that be achieved now that I made this connection? and B)Why do I see a from page and two page box now instead of one using the sample at https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage ?

    See also similar discussion here: http://wordpress.stackexchange.com/questions/8848/one-page-multiple-parents

    Plugin Author scribu
    Member

    @scribu

    A) Does this mean I can now load permalinks with different page parents

    No, it doesn’t. At the momemnt, P2P doesn’t interfere with permalinks in any way.

    B) Why do I see a from page and to page box now

    One box is for the children and the other is for the parents. See https://github.com/scribu/wp-posts-to-posts/wiki/Reciprocal-connections

    Rhand
    Participant

    @rhand

    Does that mean you CAN connect one child page to two parents? Wondering if I can use this in some way to load a child page’s content under different parents without recreating the same child page again and again using a different name..

    Plugin Author scribu
    Member

    @scribu

    You can, but you’ll have to handle the permalinks yourself.

    Rhand
    Participant

    @rhand

    Thanks so far Scribu!
    So let’s say I have

    • regular (parent) – tarifs (child)
    • reference (parent) – tarifs (same child)
    • professionals (parent) – tarifs (same child)

    I can add tarifs to these three pages as in FROM pages, making them parents?

    But then I would still have the permalink issue. Using %postname% now, which is supposed to work, but still having issues.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Posts 2 Posts] Page with more than one parent’ is closed to new replies.