[Plugin: Posts 2 Posts] Show connected links in archive templates
-
Hi,
Right now Im using this code in single templates, to show the connected links.
<?php $connected = new WP_Query( array( 'connected_type' => 'events_to_location', 'connected_items' => get_queried_object(), ) ); if ( $connected->have_posts() ) :?> <?php while( $connected->have_posts() ) : $connected->the_post();?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php endwhile; wp_reset_postdata(); endif; ?>But this code, doesen’t show anything in archive templates. What code, should I use inseted of this, to display links in archive templates?
Thank you.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘[Plugin: Posts 2 Posts] Show connected links in archive templates’ is closed to new replies.