0 ) : ?>
term_id );
?>
name ); ?>
';
if( isset($prev_post->ID) && get_permalink($prev_post->ID) ) :
$page_switcher.= '';
else :
$page_switcher.= '';
endif;
$page_switcher.= ''.jevelin_count_posts().'';
if( isset($next_post->ID) && get_permalink($next_post->ID) ) :
$page_switcher.= '';
else :
$page_switcher.= '';
endif;
$page_switcher.= '
';
echo wp_kses_post( $page_switcher );
endif; ?>
term_id;
endforeach;
$args = array(
'post__not_in' => array( get_the_ID() ),
'posts_per_page' => 3,
'ignore_sticky_posts' => 1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => $categories,
'operator' => 'IN',
),
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-quote', 'post-format-link' ),
'operator' => 'NOT IN'
)
),
'orderby' => 'rand'
);
$related_posts = new WP_Query( $args );
if( $related_posts->post_count < 3 ) :
$args = array(
'post__not_in' => array( get_the_ID() ),
'posts_per_page' => 3,
'ignore_sticky_posts' => 1,
'orderby' => 'rand'
);
$related_posts = new WP_Query( $args );
endif;
if( $related_posts->have_posts() ) :
while ( $related_posts->have_posts() ) : $related_posts->the_post(); ?>
>