<?php
/**
* Blog Post Main File.
*
* @package DIZITI
* @author Codify Theme
* @version 1.0
*/
get_header();
$options = diziti_WSH()->option();
$data = \DIZITI\Includes\Classes\Common::instance()->data( 'single' )->get();
$layout = $data->get( 'layout' );
$sidebar = $data->get( 'sidebar' );
$layout = ( $layout ) ? $layout : 'full';
$sidebar = ( $sidebar ) ? $sidebar : '';
if (is_active_sidebar( $sidebar )) {$layout = 'right';} else{$layout = 'full';}
$class = ( !$layout || $layout == 'full' ) ? 'col-12 col-lg-12' : 'col-12 col-lg-8';
if ( class_exists( '\Elementor\Plugin' ) && $data->get( 'tpl-type' ) == 'e') {
while(have_posts()) {
the_post();
the_content();
}
} else {
?>
<?php if ( $data->get( 'enable_banner' ) ) : ?>
<?php do_action( 'diziti_banner', $data );?>
<?php else:?>
<!-- Breadcrumb Section Start-->
<div class="breadcrumb-wrapper bg-cover pt-60 wow fadeInUp" data-wow-delay=".6s"
<?php if( $data->get( 'banner' ) ){?>style="background-image: url('<?php echo esc_url( $data->get( 'banner' ) ); ?>');"<?php };?>>
<div class="container">
<div class="page-heading">
<h1 class="wow fadeInUp" data-wow-delay=".3s"><?php if( $data->get( 'title' ) ) echo wp_kses( $data->get( 'title' ), true ); else( the_title( ) ); ?></h1>
<ul class="breadcrumb-items wow fadeInUp" data-wow-delay=".5s">
<?php echo diziti_the_breadcrumb(); ?>
</ul>
</div>
</div>
</div>
<!--Breadcrumb Section End-->
<?php endif;?>
<!-- Start Blog Single Page -->
<section class="news-standard fix section-padding">
<div class="container">
<div class="news-details-wrapper style1">
<div class="row g-4">
<?php if( $data->get( 'layout' ) == 'left' ): ?>
<div class="col-12 col-lg-4">
<div class="blog-main-sidebar">
<?php dynamic_sidebar( $sidebar ); ?>
</div>
</div>
<?php endif; ?>
<div class="content-side <?php echo esc_attr( $class ); ?>">
<?php while ( have_posts() ) : the_post();
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
?>
<div class="blog-post-details">
<div class="thm-unit-test">
<div class="single-blog-post">
<?php if(has_post_thumbnail()){ ?>
<div class="post-featured-thumb bg-cover img-custom-anim-left"
style="background-image: url('<?php echo esc_url($post_thumbnail_url); ?>');"></div>
<?php } ?>
<div class="post-content">
<ul class="post-list d-flex align-items-center wow fadeInUp" data-wow-delay=".4s">
<?php if( $options->get('single_post_date') != true ){ ?>
<li>
<i class="far fa-calendar-alt"></i>
<?php echo get_the_date(); ?>
</li>
<?php } ?>
<?php if( $options->get('single_post_author') != true ){ ?>
<li>
<i class="fa-regular fa-user"></i>
<?php esc_html_e('By', 'diziti'); ?> <?php the_author(); ?>
</li>
<?php } ?>
<?php if( has_category() ){ ?>
<li>
<i class="fa-regular fa-folder-open"></i>
<?php the_category(' '); ?>
</li>
<?php } ?>
</ul>
<h3 class="wow fadeInUp" data-wow-delay=".6s"><?php the_title(); ?></h3>
<?php the_content(); ?>
</div>
</div>
<div class="row tag-share-wrap">
<?php if(has_tag()){ ?>
<div class="col-lg-8 col-12 d-flex align-items-center wow fadeInUp"
data-wow-delay=".4s">
<h3 class="me-3"><?php esc_html_e('Tags:', 'diziti'); ?></h3>
<div class="tagcloud">
<?php the_tags( '', '', '' ); ?>
</div>
</div>
<?php } ?>
<div class="col-lg-4 col-12 mt-2 text-lg-end">
<div class="social-share wow fadeInUp" data-wow-delay=".6s">
<?php echo diziti_get_social_icon(); ?>
</div>
</div>
</div>
<?php if((get_previous_post()) || (get_next_post())): ?>
<div class="navigation-controls wow fadeInUp" data-wow-delay=".6s">
<?php global $post; $prev_post = get_previous_post();
if (!empty($prev_post)):
?>
<div class="nav-item previous">
<a href="<?php echo esc_url(get_the_permalink($prev_post->ID)); ?>">
<div class="icon">
<i class="fa-regular fa-arrow-left"></i>
</div>
</a>
<h4 class="label"><?php esc_html_e('Previous', 'diziti'); ?></h4>
</div>
<?php endif; ?>
<?php global $post; $next_post = get_next_post();
if (!empty($next_post)):
?>
<div class="nav-item next">
<h4 class="label"><?php esc_html_e('Next', 'diziti'); ?></h4>
<a href="<?php echo esc_url(get_the_permalink($next_post->ID)); ?>">
<div class="icon">
<i class="fa-regular fa-arrow-right"></i>
</div>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<!--End post-details-->
<?php comments_template(); ?>
</div>
<!--End thm-unit-test-->
</div>
<!--End blog-content-->
<?php endwhile; ?>
</div>
<?php if( $data->get( 'layout' ) == 'right' ): ?>
<div class="col-12 col-lg-4">
<div class="blog-main-sidebar">
<?php dynamic_sidebar( $sidebar ); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</section>
<!--End blog area-->
<?php
}
get_footer();