Articles of plugin posts to posts

Getting Post ID from slug during init

I am trying to add a url rewrite rule that finds any posts that are connected to the current post (using Posts 2 Posts by scribu). It’s tied into the WP Query object, so all I have to do is pass another variable “connected” => $post_id and it works. This is my rule that I […]

Plugin Posts 2 Posts : problems with the 'position' field

I must be a bit slow, I still have problems with the position field in the Posts-2-Posts plugin. If I set a position to each connection in a given post (say 1, 2 and 3) I don’t understand how to display these connections in this order. I thought this would do the job : $xxx […]

Combine the results of two loops

I currently have these 2 loops running on a single page $related = p2p_type( ‘artist_to_song’ )->my_get_related( get_queried_object() ); $features = p2p_type( ‘song_to_feature’ )->my_get_related( get_queried_object() ); if ( $related->have_posts() ) : while ( $related->have_posts() ) : $related->the_post(); //content endwhile; wp_reset_postdata(); endif; if ( $features->have_posts() ) : while ( $features->have_posts() ) : $features->the_post(); //content endwhile; wp_reset_postdata(); endif; […]

Different values for get_author_posts_url and get_the_author (posts 2 posts)

Caveat- I’m not a programmer, I’m a designer that has taught myself basic php/wordpress theming. This is a very specific question, I realize, but I’m hoping the experts can help me find some universal principle I’ve overlooked. I am using the plugin posts 2 posts to generate a relationship between the CPT “speakers” to wordpress […]

Post 2 Post Site Search

I’m trying to filter search terms bases on categorisation created by posts 2 posts. I’m using the generic site search and then I’ve created a search filter function my_filter_the_search($query){ $site_category = filter_input(INPUT_GET, ‘site_category’, FILTER_SANITIZE_STRING); $args = array( ‘connected_type’ => ‘sitecat_to_product’, ‘connected_items’ => $query ); $query->set( ‘query’, $args ); return $query; } to run before the […]

Post 2 Post: Getting connected 'person' from post author

I am using the amazing P2P plugin (many thanks Scribu!) and I am having an issue that is probably right in front of my face but I just can’t see. I have a ‘People’ as CPT and I have connected that to ‘Users’ with a ‘Person_to_User’ connection I created. On single posts I want to […]

Render P2P metabox per taxonomy term

I would like to display a Posts to Posts connection registration metabox for each term in a custom taxonomy. The post connection candidates will be split across the metaboxes depending on their term. Each post only has one term associated, so there is no risk of duplicate candidates. For example, given these posts and terms: […]

Posts2Posts plugin and wp user frontend connect programmatically

I have a page (custom_post_type_A) with a form (from plugin wp user frontend, create custom_post_type_B) in this page. When (in frontend) user insert value in the form i want an action wordpress for CONNECT (with Posts2Posts plugin) CPT_A with CPT_B. I use in my functions.php: function my_connection_collette_types() { p2p_register_connection_type( array( ‘name’ => ‘CPT_A_to_CPT_B’, ‘from’ => […]

One-to-many post relationships that are displayed by category (using posts-to-posts plugin)

Urgently need help. Please direct me to the proper forum if necessary, but I very much need to solve this. I’m creating a property management site in which the basic functionality must work like this: User logs on and sees buildings/properties under their management. User clicks a building and sees categories of service/repair items (electrical, […]

Controling the display order of connections

My question resembles one I asked before: [Plugin: Posts 2 Posts] Changing display order of connections But now I want to display the connection in the SAME order I created them ! That is, if I attache quote#1 THEN quote#2 to an article, I want quote#1 to appear before quote#2 regardless of the creation date […]