WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
Page with more than one parent (6 posts)

  1. Rhand
    Member
    Posted 2 years ago #

    Is it possible with this plugin to create a page connected to two or more parent pages? So can I connect one child page to several parent pages? How would this be done? Just trying to find a way around the one parent per child page limitation here.

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

  2. Rhand
    Member
    Posted 2 years ago #

    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

  3. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    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

  4. Rhand
    Member
    Posted 2 years ago #

    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..

  5. scribu
    Member
    Plugin Author

    Posted 2 years ago #

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

  6. Rhand
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic