Title: P2P archive loop
Last modified: August 20, 2016

---

# P2P archive loop

 *  [frankhertz](https://wordpress.org/support/users/frankhertz/)
 * (@frankhertz)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/p2p-archive-loop/)
 * Hi Scribu, I’m trying to make a loop that runs through one of my custom post 
   types (called “RFAs”) and displays a field from a connected CPT (called “Companies”).
   I also need to exclude certain RFAs from the loop (hence the meta query).
 * Here’s my loop, which gives me the white screen of death (I’m sure there are 
   many things wrong with this):
 *     ```
       function ticker_list() {
       query_posts( array(
       		'post_type' => array(
       					'rfa'
       				),
       				'connected_type' => 'companies_to_rfas',
       				'connected_items' => get_queried_object(),
       				'showposts' => '45',
       				'meta_key' => 'wpcf-exclude',
       				'meta_value' => array('1','2'),
       				'meta_compare' => 'NOT IN' )
       			);	while(have_posts()) : the_post();
   
       echo(types_render_field("ticker"));
   
       endwhile;
       }
       ```
   
 * _[Please post code between backticks or use the code button. Your posted code
   may now have been permanently damaged by the forum’s parser.]_
 * Thanks in advance for your help!
 * – Frank
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

The topic ‘P2P archive loop’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [frankhertz](https://wordpress.org/support/users/frankhertz/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/p2p-archive-loop/)
 * Status: not resolved