Code for single.php :
<?php
/**
* The template for displaying all single posts.
*
* @package Nisarg
*/
get_header(); ?>
<div class="container">
<div class="row">
<div id="primary" class="col-md-9 content-area">
<main id="main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content',get_post_format()); ?>
</main><!-- #main -->
<div class="post-navigation">
<?php nisarg_post_navigation(); ?>
</div>
<div class="post-comments">
<?php
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
if(!comments_open())
_e('Comments are closed.','nisarg');
?>
</div>
<?php endwhile; // End of the loop. ?>
</div><!-- #primary -->
<?php get_sidebar('sidebar-1'); ?>
</div> <!--.row-->
</div><!--.container-->
<?php get_footer(); ?>
Code for template-parts/content.php
<?php
/**
* Template part for displaying posts.
*
* @package Nisarg
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post-content'); ?>>
<?php
if ( is_sticky() && is_home() && ! is_paged() ) {
printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'nisarg' ) );
} ?>
<?php nisarg_featured_image_disaplay(); ?>
<header class="entry-header">
<span class="screen-reader-text"><?php the_title();?></span>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h2 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h2>
<?php endif; // is_single() ?>
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<h5 class="entry-date"><?php nisarg_posted_on(); ?></h5>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
the_content('...<p class="read-more"><a class="btn btn-default" href="'. esc_url(get_permalink( get_the_ID() )) . '">' . __(' Read More', 'nisarg') . '<span class="screen-reader-text"> '. __(' Read More', 'nisarg').'</span></a></p>');
?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'nisarg' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php nisarg_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->