• Hey,

    I have linked a custom post type with the ‘posts’ post type. Yesterday it was working, today however it is not functioning anymore. This is the function.

    // Link authors with post types
    	function my_connection_types() {
    	    p2p_register_connection_type( array(
    	        'name' => 'posts_to_auteurs',
    	        'from' => 'post',
    	        'to' => 'auteur'
    	    ) );
    	}
    	add_action( 'p2p_init', 'my_connection_types' );

    For some weird reason, this gives me an overview of all my ‘posts’ instead of all the ‘auteurs’ (dutch for authors).

    Can someone help?

    https://www.ads-software.com/plugins/posts-to-posts/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jrtderonde

    (@jrtderonde)

    Also, changing around the 'from' =? 'to' args doesn’t resolve the problem.

    Can you post the query you are using to get them?

    Hi jrtderonde,

    I have the same issue as you. Did you find a solution by any chance?

    Many thanks.

    Thread Starter jrtderonde

    (@jrtderonde)

    Hey TheMoutch,

    In my specific situation I wanted to link a “user” (author) to a post. I fixed this by creating several accounts for specific authors. To complete the link I inserted a “user” field by using the Advanced Custom Fields plugin.

    Hope this works for you as well. I found the p2p plugin very buggy tho.

    Regards

    Hey jrtderonde,

    Thank you so much for getting back to me so quickly. I don’t think this will work in my situation (linking a post to several custom posts) but I’ll keep searching.

    Best,

    TheMoutch

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Relate custom post type to post’ is closed to new replies.