   <?php
/**
 * Theme Name: EduCare
 * Theme URI: http://demo.com/educare
 * Author: demo.com
 * Author URI: http://demo.com
 * Description: Themes Is WordPress Theme Market
 * @package eschool
 */
 global $codedokan;
 ?> 
 
 <?php 
								$count_posts = wp_count_posts( 'post' )->publish;
								if ($count_posts == 1){
									get_template_part( 'template-parts/html/blog' );
								}else{
								?>
								

                    <!--=========codedokan==============
                        Blog section Start
                    =============codedokan=============-->    
        <section class="blog-section">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12 col-md-12">
                        <div class="sec-content">
                            <h1 class="sec-title">
                                <?php echo $codedokan['blog_title']; ?>
                            </h1>
                            <div class="secIcon">
                                <img src="<?php echo get_template_directory_uri(); ?>/assets/images/heading-line.png" alt="">
                            </div>
                        </div>
                    </div>
                </div><!--End row-->

                <div class="row">
                    <div class="col-lg-12">
                        <div class="blog-active owl-carousel">
                            
							
							<?php
								$cat = $codedokan['blog_cat'];
								if($cat == NULL){ $cat = 1; }else{ $cat = $cat; }
								$cat_how = $codedokan['how_blog'];
							?>
							
											
								<?php
									$code_dokan = new WP_Query(array(
									'post_type' => 'post',
									'posts_per_page' =>$cat_how,
									'offset' => 0,
									'cat' => $cat,
								));
								while ($code_dokan->have_posts()) : $code_dokan->the_post(); ?>
								
							
							<div class="blog-wrpp">
							<?php $image = wp_get_attachment_url( get_post_thumbnail_id($post->ID)); if($image){?>
                                <figure class="blog-image">
                                    <img class="lazyload" src="<?php echo $image; ?>" data-src="<?php echo $image; ?>">	
                                </figure>
							<?php } ?>
    
                                <div class="blog-item">
                                    <div class="blog-date">
                                        <ul>
										<?php $author_name = get_post_meta(get_the_ID(),'author_name', true);
																if($author_name){ ?>
                                            <li> <i class="las la-user"></i> <a href=""><?php echo $author_name; ?></a></li>
																<?php } ?>
                                            <li> <i class="las la-calendar"></i> <?php echo get_the_time("j F Y"); ?> </li>
                                        </ul>
                                    </div>
    
                                    <h1 class="blog-title">
                                        <a href="<?php the_permalink()?>"><?php the_title() ?> </a>
                                    </h1>
    
                                    <div class="blog-details">
                                        <?php echo excerpt($codedokan['how_blog_word']); ?>
                                    </div>
    
                                    <div class="blog-btn">
                                        <a href="<?php the_permalink(); ?>"> <i class="las la-angle-right"></i> <?php echo $codedokan['read_more']; ?> </a>
                                    </div>
                                </div>
                            </div><!--End wrpp-->
                            
                            <?php endwhile; ?>
                            
                    

                        </div><!--End owl-carousel-->
                    </div><!--End col-12-->
                </div><!--Edn row-->
            </div><!--End container-->
        </section><!--End section-->
            
            
                <!--=========codedokan==============
                    Blog section End
                =============codedokan=============-->    

          <?php } ?>