// Start the loop.
while ( have_posts() ) : the_post();
// Include the single post content template.
get_template_part( 'template-parts/content', 'single' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) {
comments_template();
}
edit_post_link(
sprintf(
/* translators: %s: Name of current post */
__( 'Edit "%s"', 'twentysixteen' ),
get_the_title()
),
'',
''
);
if ( is_singular( 'attachment' ) ) {
// Parent post navigation.
the_post_navigation( array(
'prev_text' => _x( 'Published in%title', 'Parent post link', 'twentysixteen' ),
) );
} elseif ( is_singular( 'post' ) ) {
// Previous/next post navigation.
$category = get_the_category( get_the_ID() );
$categories = array();
foreach ( $category as $cat ) {
$categories[] = $cat->slug;
}
$category = implode( ',', $categories );
$args = array(
'post_type' => 'post',
'category_name' => $category,
'numberposts' => 4,
'posts_per_page' => 4,
'publish' => true
);
$slider_posts = get_posts( $args );
?>
foreach ( $slider_posts as $item ):
?>
endforeach;
?>
}
// End of the loop.
endwhile;
?>