Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect & related post #446

Open
Ruriko opened this issue Jun 9, 2014 · 1 comment
Open

Connect & related post #446

Ruriko opened this issue Jun 9, 2014 · 1 comment

Comments

@Ruriko
Copy link

Ruriko commented Jun 9, 2014

How do I show posts of connected & related? I tried this code but it doesn't work

// Find connected pages
$connected = new WP_Query( array(
'connected_type' => 'posts_to_pages',
'connected_items' => array( 'get_connected', 'get_related' ) get_queried_object(),
'nopaging' => true,
) );

// Display connected pages
if ( $connected->have_posts() ) :
?>
<h3>Related pages:</h3>

<?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
"><?php the_title(); ?>
<?php endwhile; ?>

<?php
// Prevent weirdness
wp_reset_postdata();

endif;
?>
@Strap1
Copy link

Strap1 commented Aug 6, 2014

Have you used your connection name in 'connected_type'? There is also some extraneous markup in your code just before 'the_title'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants