<?php
   if ( ! defined( 'ABSPATH' ) ) {
     exit; // Exit if accessed directly
   }
?>

<?php get_header(); ?>
<?php $template_url = get_bloginfo ( 'template_url' ) . '/'; ?>
<?php 
   //to check if there is a post regarding the url access the page
   if (have_posts ()) :
     the_post(); 
   endif;
   
   $img = $template_url."assets/images/breadcrumb/breadcrumb-1.png"; 
?>
<section class="breadcrumb-area" style="background-image: url(<?=$img?>);">
    <div class="banner-curve"></div>
    <div class="container">
        <div class="row">
            <div class="col-xl-12">
                <div class="inner-content clearfix text-center">
                    <div class="title wow slideInUp animated" data-wow-delay="0.3s" data-wow-duration="1500ms">
                       <h2>Blog Details<span class="dotted"></span></h2>
                    </div>
                    <div class="breadcrumb-menu wow slideInDown animated" data-wow-delay="0.3s" data-wow-duration="1500ms">
                        <ul class="clearfix">
                            <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>">Home</a></li>
                            <li class="active">Blog Details</li>
                        </ul>    
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Single News -->
<!--Start Blog Style2 Area-->
<section id="blog-area" class="blog-single-area">
    <div class="container">
        <div class="row flex-column-reverse flex-lg-row">
            <div class="col-xl-9 col-lg-9 col-md-12 col-sm-12">
                <div class="blog-posts">
                    <div class="single-blog-style2"> 
                        <div class="text-holder">
                            <!--Start Blog Details Single-->
                            <div class="blog-details-single">
                                <!--<div class="categories">-->
                                <!--    <h5>Business</h5>-->
                                <!--</div>-->
                                <h2 class="blog-title"><?php echo get_the_title();?></h2>
                                <ul class="meta-info">
                                    <li><span class="icon-calendar"></span><a href="#"><?php echo get_the_date( 'D M j' );?></a></li> 
                                </ul>
								 <div class="blog-details-image-1">
                                    <img src="<?php echo get_the_post_thumbnail_url( get_the_ID(),'full');?>" alt="">
                                </div>
                                <?php echo get_the_content();?>
                            </div>
                     
                        </div>
                    </div>
                </div>
            </div>
            
            <!--Start sidebar Wrapper-->
            <div class="col-xl-3 col-lg-3 col-md-12 col-sm-12">
                <div class="sidebar-wrapper">
                    <!--Start single sidebar-->
                    <div class="single-sidebar wow fadeInUp animated" data-wow-delay="0.2s" data-wow-duration="1200ms">
                        <div class="title">
                            <h3>Popular Feeds</h3>
                        </div>
                        <ul class="popular-feeds">
                            <?php
                        $args = array ( 
                            'post_type'      => 'post',
                            'post_status'    => 'publish', 
                            'orderby' => 'publish_date',
                            'order' => 'DESC',  
                            'posts_per_page' => 3
                        );
                    $query = new WP_Query($args);
                    $post_count = $query->post_count;
                    if ( $query->have_posts() ){
                      $i = 1;
                    while ( $query->have_posts() ){
                        $blog_img_url = get_the_post_thumbnail_url( get_the_ID(),'full');
                        $query->the_post();
                    ?>
                  <!-- Single Post -->
                  <li>
                        <div class="inner">   
                            <div class="img-box">
                                <img src="<?php echo $blog_img_url;?>" alt="Awesome Image">
                                <div class="overlay-content">
                                    <a href="<?php the_permalink();?>"><i class="fa fa-link" aria-hidden="true"></i></a>
                                </div>    
                            </div>
                            <div class="title-box">
                                <h4><a href="<?php the_permalink();?>"><?php echo get_the_title();?></a></h4>
                                <h6><span class="icon-calendar-1"></span><?php echo get_the_date( 'D M j' );?></h6>
                            </div>
                        </div>
                    </li>
                  <!-- End Single Post -->
                  <?php
                          $i++;
                          }
                        }wp_reset_postdata();
                      ?>
                        
                           
                        </ul>     
                    </div>
                    <!--End single sidebar-->
                    
                    
                    
                 
                    
                </div>    
            </div>
            <!--End Sidebar Wrapper-->
           
        </div>
    </div>
</section>
<!--End Blog Style2 Area-->

<?php get_footer(); ?>