Open
Description
Hi, first, thanky you for this amazing plugin. I have one question, how to show all related posts in single, when is set to shedule. If I Publish the post everything is fine, but if is not published and is set to shedule, related content doesnt show.
This is code I use:
// Find connected pages
$connected = new WP_Query( array(
'connected_type' => 'posts_to_pages',
'connected_items' => get_queried_object(),
'nopaging' => true,
'post_status' => array('publish','future'),
) );
// Display connected pages
if ( $connected->have_posts() ) :
?>
<ul class="submenu">
<?php while ( $connected->have_posts() ) : $connected->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->label ; ?></a> </li>
<?php endwhile; ?>
</ul>
<?php
// Prevent weirdness
wp_reset_postdata();
endif;
Thank you in advance :)