<?php 
/* 
Template Name: Template - Default with Sidebar
*/ 
?>
<?php get_header(); // add header ?>  

<!-- Begin Content -->
<div class="border-fullwidth">
<?php if (is_page_template()) { ?><div class="wrap-fullwidth-bg"><?php } else { ?><div class="wrap-fullwidth"><?php } ?>

    <?php if (is_page_template()) { ?><div class="single-content"><?php } ?>
        <article>
            <?php if (have_posts()) : while (have_posts()) : the_post();  ?>
            <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">             

                  <div id="page-title-box">
                    <h1 class="page-title"><?php the_title(); ?></h1>
                    <div class="page-title-line"></div>
                    <div class="clear"></div>
                  </div>

                  <div class="entry">
                    <?php the_content(''); // content ?>
                    <div class="clear"></div>
                    <?php wp_link_pages(); // content pagination ?>
                    <div class="clear"></div><br />
                  </div><!-- end #entry -->
            </div><!-- end .post -->
            <?php endwhile; endif; ?>
        </article>



        <?php // If comments are open or we have at least one comment, load up the comment template.
        if ( comments_open() || get_comments_number() ) { ?>
 
        <!-- Comments -->
        <section class="article-bottom">
            <div id="comments" class="comments">
                <?php if (get_comments_number()==0) { } else { ?>
                    <div class="article-btn"><h3><?php esc_html_e( 'All Comments', 'alinan-wp' ); ?></h3></div>
                <?php } ?>
                <div class="clear"></div>
                <?php comments_template('', true); // comments ?>
            </div>
            <div class="clear"></div>
        </section>
        <?php } ?> 
            
    <?php if (is_page_template()) { ?></div><!-- end .single-content --><?php } ?>

    <?php if (is_page_template()) { ?>
        <?php  get_sidebar(); // add sidebar ?>
    <?php } ?>

    <div class="clear"></div>
</div><!-- end .wrap-fullwidth -->
</div><!-- end .border-fullwidth  -->
<?php get_footer(); // add footer  ?>