Title: Search Function within Post 2 Posts
Last modified: August 20, 2016

---

# Search Function within Post 2 Posts

 *  [davidbova](https://wordpress.org/support/users/davidbova/)
 * (@davidbova)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/search-function-within-post-2-posts/)
 * Hi there. Thanks for the great plugin.
 * Having a bit of difficulty getting the search function where you choose which
   post to connect to.
 * Bit frustrating that we can’t use it since its there and theres so many connections
   to choose from.
 * Maybe I’m doing something obvious, just wondered if anyone had the same issue?
 * D
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [davidbova](https://wordpress.org/support/users/davidbova/)
 * (@davidbova)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/search-function-within-post-2-posts/#post-3232017)
 * to give a bit more; the error is only No Artists Found (artists is my connection
   type)
 * the animated gif indicating search appears, but only the error comes up. using
   the name of the post to search and tried the ID, but nothing appears
 *  Thread Starter [davidbova](https://wordpress.org/support/users/davidbova/)
 * (@davidbova)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/search-function-within-post-2-posts/#post-3232019)
 * This is my code in functions.php
 *     ```
       function my_connection_types() {
       	if ( !function_exists( 'p2p_register_connection_type' ) )
       		return;
   
       	p2p_register_connection_type( array(
       		'name' => 'Works_to_Artists',
       		'from' => 'works',
       		'to' => 'artists',
       		'reciprocal' => true
       	) );
   
       	p2p_register_connection_type( array(
       		'name' => 'Crafts_to_Artists',
       		'from' => 'crafts',
       		'to' => 'artists'
       	) );
       	p2p_register_connection_type( array(
       		'name' => 'Works_to_Crafts',
       		'from' => 'crafts',
       		'to' => 'works'
       	) );
   
       		p2p_register_connection_type( array(
       		'name' => 'Works_to_Works',
       		'from' => 'works',
       		'to' => 'works',
       		'reciprocal' => true
       	) );
   
       		p2p_register_connection_type( array(
       		'name' => 'Crafts_to_Crafts',
       		'from' => 'crafts',
       		'to' => 'crafts',
       		'reciprocal' => true
       	) );	
   
       }
       add_action( 'wp_loaded', 'my_connection_types' );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Search Function within Post 2 Posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [davidbova](https://wordpress.org/support/users/davidbova/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/search-function-within-post-2-posts/#post-3232019)
 * Status: not resolved