<?php
/**
 * The template for displaying all single posts.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package peccular Premium
 */
$peccular_lite_single_breadcrumb_section = get_theme_mod('peccular_lite_single_breadcrumb_section', '1');
$peccular_lite_single_tags_section = get_theme_mod('peccular_lite_single_tags_section', '1');
$peccular_lite_authorbox_section = get_theme_mod('peccular_lite_authorbox_section', '1');
$peccular_lite_relatedposts_section = get_theme_mod('peccular_lite_relatedposts_section', '1');

get_header(); ?> 
 <?php $image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));?>

<div class="peccular-page-main"> 
 <header class="page-main-header" 
  <?php
    if(get_theme_mod('featured_img_on_off') != 'on' ){
  ?>

 <?php  if (!empty($image)) : ?>
  style="background: url('<?php echo esc_url($image); ?>'); background-repeat: no-repeat; background-size:cover;background-position: center;  height: <?php echo esc_attr(get_theme_mod('peccular_innerpage_image_height','416')) ?>px;
  "
  <?php endif ?> 

 <?php } ?>

  >
    
<?php
    if(get_theme_mod('page_title_on_off') != 'on' ){
  ?>
    <div class="<?php if(get_theme_mod('peccular_inner_page_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('peccular_inner_page_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?> <?php echo esc_attr(get_theme_mod('peccular_innerpage_header_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="1s">
        <?php the_title( '<h1 class="ht-main-title">', '</h1>' ); ?>
        <div class="clearfix"></div>
    </div>
 <?php } ?> 
 <?php
    if(get_theme_mod('breadcrumb_on_off') != 'on' ){
  ?>
        
            <div class="<?php if(get_theme_mod('peccular_inner_page_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('peccular_inner_page_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">
                <div class="breadcrumbbox <?php echo esc_attr(get_theme_mod('peccular_innerpage_header_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="1s">
                <div class='button'><?php peccular_lite_the_breadcrumb(); ?></div>
                <!--  <?php //peccular_lite_the_breadcrumb(); ?> -->
            </div>
        </div>
 <?php } ?>   

</header><!-- .entry-header --> 
<div class="peccular-innerpage-overlay"></div>
</div>
<main id="innerpage-box">
   <div class="<?php if(get_theme_mod('peccular_inner_page_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('peccular_inner_page_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>" >
        <div class="inner_contentbox">
        <div id="content-box" class="innerpage-whitebox">
          <div class="row">
        <?php if (get_theme_mod('peccular__blogspost_layout') == '1' ) { ?>

            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
              <div id="secondary" class="widget-area">
                <?php  dynamic_sidebar('peccular-blog-sidebar'); ?>
              </div>
            </div>

        <article class="article col-lg-8 col-md-8 col-sm-8 col-xs-12">       
                <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
                    <div class="single_post">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                         
                        <div class="blog-info-area"> 
                            <?php if (get_theme_mod('peccular_single_show_author',true) != false || get_theme_mod('peccular_single_show_date',true) != false || get_theme_mod('peccular_single_show_time',true) != false || get_theme_mod('peccular_single_show_category',true) != false || get_theme_mod('peccular_single_show_comments',true) != false || get_theme_mod('peccular_single_show_tags',true) != false){ ?>
                            <div class="metabox"> 
                              <div class="metabox2brdr"> 
                              <ul>
                                <li>
                                  1

                              <?php if (get_theme_mod('peccular_single_show_author',true) != false){ ?>
                               <div class="blog-author"><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo esc_attr( get_the_author() ); ?>"><i class="fa fa-user" aria-hidden="true"></i> by <?php echo get_the_author(); ?> </a>

                              </div>
                              <?php }?>
                              </li>
                              <li>
                              <?php if (get_theme_mod('peccular_single_show_date',true) != false){ ?>
                                <div class="single-blog-date"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo get_the_date( 'j F, Y' ); ?></div>
                              <?php }?>
                              </li>
                              <li>
                               <?php if (get_theme_mod('peccular_single_show_time',true) != false){ ?>
                                <div class="blog-time"><i class="fa fa-clock-o" aria-hidden="true"></i><?php echo the_time( 'g:i a' ) ?></div>
                              <?php }?>
                              </li>
                              <li>
                               <?php if (get_theme_mod('peccular_single_show_category',true) != false){ ?>
                                <div class="blog-category"> 
                                  <span>
                                    <?php
                                        // Get the ID of a given category
                                        $category_id = get_cat_ID( 'Category Name' );
                                     
                                        // Get the URL of this category
                                        $category_link = get_category_link( $category_id );
                                    ?>
                                    <a href="<?php echo esc_url( $category_link ); ?>" title="Category Name">
                                    <i class="fa fa-file-o" aria-hidden="true"></i><?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?></a>
                                  </span>
                                </div>
                              <?php }?>
                              </li>
                              <li>
                              <?php if (get_theme_mod('peccular_single_show_comments',true) != false){ ?>
                                  <div class="blog-comment"><i class="fa fa-comment-o" aria-hidden="true"></i><?php get_comments_number() ?></div>
                              <?php }?>
                              </li>
                              </ul>
                               <div class="clearfix"></div>
                            </div>
                                 <div class="clearfix"></div>
                             <!-- Start Content -->
                       <div id="content" class="post-single-content box mark-links">
                        <?php the_content(); ?>                     
                      
                        </div><!-- End Content -->   
                        <div class="blog-page-btn">
                            <a href="<?php the_permalink(); ?>" target="_blank">      
                             <i class="fa fa-caret-square-o-right" aria-hidden="true"></i> Read More
                            </a>
                        </div>
                             <div class="clearfix"></div>
                           
                                <?php if (get_theme_mod('peccular_single_show_tags',true) != false){ ?>
                                  <div class="blog-tags">
                                    <i class="fa fa-tags" aria-hidden="true"></i>
                                    <?php
                                          if( $tags = get_the_tags() ) {
                                            foreach( $tags as $content_tag ) {
                                              $sep = ( $content_tag === end( $tags ) ) ? '' : ' ';
                                              echo '<a href="' . esc_url(get_term_link( $content_tag, $content_tag->taxonomy )) . '" class="ml-2 mb-2">' . esc_html($content_tag->name) . '</a>' . esc_html($sep);
                                            }
                                          } ?>
                      
                                    </div>
                              <?php }?>
                              
                            </div>
                          <?php }?>                         
                        </div>
                       

                          <?php if(get_theme_mod('single_blog_socials_on_off') != 'on' ){ ?>

                        <div class="socialMedia">
                          <ul>
                            <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
                            <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php the_title();?>" target="_blank" class="site-button sharp"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
                            
                            <li><a href="https://twitter.com/share?url=<?php the_permalink();?>&amp;text=<?php the_title();?>" class="site-button sharp" target="_blank"><i class="fa-brands fa-x-twitter"></i></a></li>
                            <li><a href="http://www.digg.com/submit?url=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-digg" aria-hidden="true"></i></a></li>
                            <li class="share-button"><a href="#" class="site-button sharp"><i class="fa fa-share-alt"></i></a></li>
                          </ul>
                            <div class="clearfix"></div>
                        </div>
                    <?php } ?>

                     <?php if (get_theme_mod('peccular_single_show_comments',true) != false){ ?>
                                  <div class="blog-comment"><?php comments_template( '', true ); ?></div>
                              <?php }?>
                       

                    </div>
                </div>
            <?php endwhile; ?>
        </article>
        </div>

<?php } else if (get_theme_mod('peccular__blogspost_layout') == '0' ) {?>


 <article class="article">       
                <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
                    <div class="single_post">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        
                        <div class="blog-info-area"> 
                            <?php if (get_theme_mod('peccular_single_show_author',true) != false || get_theme_mod('peccular_single_show_date',true) != false || get_theme_mod('peccular_single_show_time',true) != false || get_theme_mod('peccular_single_show_category',true) != false || get_theme_mod('peccular_single_show_comments',true) != false || get_theme_mod('peccular_single_show_tags',true) != false){ ?>
                            <div class="metabox"> 
                              <div class="metabox2brdr"> 
                             <ul>
                                <li>
                              <?php if (get_theme_mod('peccular_single_show_author',true) != false){ ?>
                               <div class="blog-author"><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo esc_attr( get_the_author() ); ?>"><i class="fa fa-user" aria-hidden="true"></i> by <?php echo get_the_author(); ?> 
                             </a>
                              </div>
                              <?php }?>
                              </li>
                              <li>
                              <?php if (get_theme_mod('peccular_single_show_date',true) != false){ ?>
                                <div class="single-blog-date"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo get_the_date( 'j F, Y' ); ?></div>
                              <?php }?>
                              </li>
                              <li>
                               <?php if (get_theme_mod('peccular_single_show_time',true) != false){ ?>
                                <div class="blog-time"><i class="fa fa-clock-o" aria-hidden="true"></i><?php echo the_time( 'g:i a' ) ?></div>
                              <?php }?>
                              </li>
                              <li>
                               <?php if (get_theme_mod('peccular_single_show_category',true) != false){ ?>
                                <div class="blog-category"> 
                                <span>
                                 <?php
                                 // Get the ID of a given category
                                      $category_id = get_cat_ID( 'Category Name' );
                                   
                                      // Get the URL of this category
                                      $category_link = get_category_link( $category_id );
                                  ?>
                                    <a href="<?php echo esc_url( $category_link ); ?>" title="Category Name"><i class="fa fa-file-o" aria-hidden="true"></i><?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?>
                                  </a>
                                  </span>
                                </div>
                              <?php }?>
                              </li>
                             <li>
                              <?php if (get_theme_mod('peccular_single_show_comments',true) != false){ ?>
                                  <div class="blog-comment"><i class="fa fa-comment-o" aria-hidden="true"></i><?php get_comments_number() ?></div>
                              <?php }?>
                              </li>
                              </ul>
                               <div class="clearfix"></div>
                            </div>
                            <div class="clearfix"></div>
                             <!-- Start Content -->
                       <div id="content" class="post-single-content box mark-links">
                        <?php the_content(); ?>                     
                      
                        </div><!-- End Content -->   
                        <div class="blog-page-btn">
                            <a href="<?php the_permalink(); ?>" target="_blank">      
                             <i class="fa fa-caret-square-o-right" aria-hidden="true"></i> Read More
                            </a>
                        </div>
                             <div class="clearfix"></div>                            
                           
                                <?php if (get_theme_mod('peccular_single_show_tags',true) != false){ ?>
                                  <div class="blog-tags">
                                    <i class="fa fa-tags" aria-hidden="true"></i>
                                    <?php
                                          if( $tags = get_the_tags() ) {
                                            foreach( $tags as $content_tag ) {
                                              $sep = ( $content_tag === end( $tags ) ) ? '' : ' ';
                                              echo '<a href="' . esc_url(get_term_link( $content_tag, $content_tag->taxonomy )) . '" class="ml-2 mb-2">' . esc_html($content_tag->name) . '</a>' . esc_html($sep);
                                            }
                                          } ?>
                      
                                    </div>
                              <?php }?>
                              
                            
                            </div>
                          <?php }?>                         
                        </div>
                          

                          <?php if(get_theme_mod('single_blog_socials_on_off') != 'on' ){ ?>

                        <div class="socialMedia">
                          <ul>
                            <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
                            <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php the_title();?>" target="_blank" class="site-button sharp"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
                            
                            <li><a href="https://twitter.com/share?url=<?php the_permalink();?>&amp;text=<?php the_title();?>" class="site-button sharp" target="_blank"><i class="fa-brands fa-x-twitter"></i></a></li>
                            <li><a href="http://www.digg.com/submit?url=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-digg" aria-hidden="true"></i></a></li>
                            <li class="share-button"><a href="#" class="site-button sharp"><i class="fa fa-share-alt"></i></a></li>
                          </ul>
                            <div class="clearfix"></div>
                        </div>
                    <?php } ?>

                    <?php if (get_theme_mod('peccular_single_show_comments',true) != false){ ?>
                                  <div class="blog-comment"><?php comments_template( '', true ); ?></div>
                              <?php }?>

                                <div class="clearfix"></div>
                       
                     
                    </div>
                </div>
                  <div class="clearfix"></div>
            <?php endwhile; ?>
        </article>
<?php } if (get_theme_mod('peccular__blogspost_layout') == '2' ) { ?>

  <div class="row">
    <article class="article col-lg-8 col-md-8 col-sm-8 col-xs-12">       
                <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
               <div id="post-<?php the_ID(); ?>" <?php post_class('post'); ?>>
                    <div class="single_post">
                        <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
                        
                        <div class="blog-info-area"> 
                            <?php if (get_theme_mod('peccular_single_show_author',true) != false || get_theme_mod('peccular_single_show_date',true) != false || get_theme_mod('peccular_single_show_time',true) != false || get_theme_mod('peccular_single_show_category',true) != false || get_theme_mod('peccular_single_show_comments',true) != false || get_theme_mod('peccular_single_show_tags',true) != false){ ?>
                            <div class="metabox"> 
                              <div class="metabox2brdr"> 
                              <ul>
                                <li>
                              <?php if (get_theme_mod('peccular_single_show_author',true) != false){ ?>
                               <div class="blog-author"><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo esc_attr( get_the_author() ); ?>"><i class="fa fa-user" aria-hidden="true"></i> by <?php echo get_the_author(); ?> 
                             </a>
                              </div>
                              <?php }?>
                              </li>
                              <li>
                              <?php if (get_theme_mod('peccular_single_show_date',true) != false){ ?>
                                <div class="single-blog-date"> <i class="fa fa-calendar" aria-hidden="true"></i> <?php echo get_the_date( 'j F, Y' ); ?></div>
                              <?php }?>
                              </li>
                              <li>
                               <?php if (get_theme_mod('peccular_single_show_time',true) != false){ ?>
                                <div class="blog-time"><i class="fa fa-clock-o" aria-hidden="true"></i><?php echo the_time( 'g:i a' ) ?></div>
                              <?php }?>
                              </li>
                              <li>
                               <?php if (get_theme_mod('peccular_single_show_category',true) != false){ ?>
                                <div class="blog-category"> 
                                  <span>
                                    <?php
                                      // Get the ID of a given category
                                      $category_id = get_cat_ID( 'Category Name' );
                                   
                                      // Get the URL of this category
                                      $category_link = get_category_link( $category_id );
                                  ?>
                                    <a href="<?php echo esc_url( $category_link ); ?>" title="Category Name"><i class="fa fa-file-o" aria-hidden="true"></i><?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?>
                                  </a></span>
                                </div>
                              <?php }?>
                              </li>
                              <li>
                              <?php if (get_theme_mod('peccular_single_show_comments',true) != false){ ?>
                                  <div class="blog-comment"><i class="fa fa-comment-o" aria-hidden="true"></i><?php get_comments_number() ?></div>
                              <?php }?>
                              </li>
                              </ul>
                               <div class="clearfix"></div>
                            </div>
                            <div class="clearfix"></div>
                             <!-- Start Content -->
                       <div id="content" class="post-single-content box mark-links">
                        <?php the_content(); ?>                     
                      
                        </div><!-- End Content -->   
                        <div class="blog-page-btn">
                            <a href="<?php the_permalink(); ?>" target="_blank">      
                             <i class="fa fa-caret-square-o-right" aria-hidden="true"></i> Read More
                            </a>
                        </div>
                             <div class="clearfix"></div>
                           
                              
                                <?php if (get_theme_mod('peccular_single_show_tags',true) != false){ ?>
                                  <div class="blog-tags">
                                    <i class="fa fa-tags" aria-hidden="true"></i>
                                    <?php
                                          if( $tags = get_the_tags() ) {
                                            foreach( $tags as $content_tag ) {
                                              $sep = ( $content_tag === end( $tags ) ) ? '' : ' ';
                                              echo '<a href="' . esc_url(get_term_link( $content_tag, $content_tag->taxonomy )) . '" class="ml-2 mb-2">' . esc_html($content_tag->name) . '</a>' . esc_html($sep);
                                            }
                                          } ?>
                      
                                    </div>
                              <?php }?>
                              
                            
                            </div>
                          <?php }?>                         
                        </div>

                        
                          <?php if(get_theme_mod('single_blog_socials_on_off') != 'on' ){ ?>

                        <div class="socialMedia">
                          <ul>
                            <li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
                            <li><a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink();?>&title=<?php the_title();?>&source=<?php the_title();?>" target="_blank" class="site-button sharp"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
                            
                            <li><a href="https://twitter.com/share?url=<?php the_permalink();?>&amp;text=<?php the_title();?>" class="site-button sharp" target="_blank"><i class="fa-brands fa-x-twitter"></i></a></li>
                            <li><a href="http://www.digg.com/submit?url=<?php the_permalink();?>" target="_blank" class="site-button sharp"><i class="fa fa-digg" aria-hidden="true"></i></a></li>
                            <li class="share-button"><a href="#" class="site-button sharp"><i class="fa fa-share-alt"></i></a></li>
                          </ul>
                            <div class="clearfix"></div>
                        </div>
                    <?php } ?>

                     <?php if (get_theme_mod('peccular_single_show_comments',true) != false){ ?>
                                  <div class="blog-comment"><?php comments_template( '', true ); ?></div>
                              <?php }?>
                       <div class="clearfix"></div>

                    </div>
                </div>
            <?php endwhile; ?>
        </article>

    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
      <div id="secondary" class="widget-area">
        <?php dynamic_sidebar('peccular-blog-sidebar'); ?>
      </div>
    </div>
  </div>


<?php } ?> 

           
        <!-- End Article -->
        <!-- Start Sidebar -->
        <?php // get_sidebar(); ?>
        <!-- End Sidebar -->
    </div>
    <div class="clearfix"></div>
</div>
  <div class="clearfix"></div>
</div>
</main>
<?php get_footer(); ?>
