• Hello,

    I’m working with Posts 2 Posts for an educational project and I need a help.

    I want to make relations between universities and a colleges. Both are custom posts.

    The problem is that I want to limit it so you can make the connection just if you are author of “university”.

    I searched on documentation and I didn’t find something like that.

    Thank you for you help.

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

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

    (@scribu)

    Well, one solution would be to set ‘admin_box’ => ‘from’:

    https://github.com/scribu/wp-posts-to-posts/wiki/Admin-box-display

    so that the connections metabox shows up just on the university edit screen.

    Then, only users that are able to edit that university (the author, editors and admins) can create connections.

    Hi,

    you really have done an Awesome job by creating this plugin. I was looking to create the relations between Post or Page But your work has proved it.

    I also want to use this plugin for my educational site where i want to make relations between courses and Institues But i am unable to Register a connection type in functions.php in my theme I am using a Premium Edublog Theme of WPMUDEV http://premium.wpmudev.org/project/the-edublogs-homepage-theme Kindly Let me know how to do this.

    Thanks in Advance.

    Jatinder Dhiman

    Plugin Author scribu

    (@scribu)

    @pdhiman: Please open a new topic, containing the code you are trying to use.

    I am new to WP and need you help in my project Can you give me your email id or phone no. So that i can discuss about my project.

    I am just putting the same code mentioned on https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage

    <?php
    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’ => ‘posts_to_pages’,
    ‘from’ => ‘post’,
    ‘to’ => ‘page’
    ) );
    }
    add_action( ‘wp_loaded’, ‘my_connection_types’ );
    ?>

    DO i have to make a change in this?

    Plugin Author scribu

    (@scribu)

    No, you don’t need to change that code.

    But what do you mean by “I am not able to register a connection”? Do you get an error, a white screen? Or you just don’t see the connections box when editing a page or a post?

    I mean according to the given instruction for Basic usage their is heading Registering a connection type I am using that code in my theme’s functions.php but i don’t know where i have to paste that code but as i have tried that code pasting in the functions.php file every time it giving error. That’s what i mean “I am not able to register a connection”

    Plugin Author scribu

    (@scribu)

    Well, I’m sorry, but you need a minimum knowledge of PHP to use this plugin.

    Maybe try using ZigConnect instead (where you can register connection types from the admin area).

    Thanks for every time replying so fast………

    Hi,
    One more question. Will the plugin Post to Posts support multisite?

    Plugin Author scribu

    (@scribu)

    Yes, it works on multisite, but if you want to enabled it network-wide, you’ll also have to install the Proper Network Activation plugin.

    Hi,
    I have some knowledge of PHP and I am using the following code in in my functions.php

    <?php
    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' => 'posts_to_pages',
    		'from' => 'Instittues',
    		'to' => 'Courses'
    	) );
    }
    add_action( 'wp_loaded', 'my_connection_types' );
    ?>

    an i am getting the error Parse error: syntax error, unexpected ‘}’

    I have done this for Post to Pages and a Connection Widget appeared in the page. Please let me know if i want to do the same for post to post.
    Thanks in advance

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: Posts 2 Posts] New connection just for the author’ is closed to new replies.