post_password ) { $previous_post = null; } if ( $next_post instanceof WP_Post && '' !== (string) $next_post->post_password ) { $next_post = null; } } ?>
>

0 ) : $excluded_related_ids = array(); if ( $previous_post instanceof WP_Post ) { $excluded_related_ids[] = (int) $previous_post->ID; } if ( $next_post instanceof WP_Post ) { $excluded_related_ids[] = (int) $next_post->ID; } $related_ids = SG7G_Related::get_ids( $post_id, $related_count, $excluded_related_ids ); if ( $related_ids ) : $related = new WP_Query( array( 'post_type' => 'sg7g_media', 'post_status' => 'publish', 'has_password' => false, 'posts_per_page' => count( $related_ids ), 'post__in' => $related_ids, 'orderby' => 'post__in', 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'update_post_meta_cache' => true, 'update_post_term_cache' => true, ) ); if ( $related->have_posts() ) : ?>