<?php
/**
 * Template Name: Full width Timeline Blog Template
 *
 * @package WordPress
 * @subpackage Probit
 * @since Probit 1.0
 *
 */
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}
get_header();
?>

<div class="single_top_bar entry-header">
    <div class="container">
        <div class="row">
            <h1 class="entry-title text-capitalize col-xs-12"><?php the_title(); ?></h1>
            <?php if (get_theme_mod('enable_breadcrumbs')) { ?>
                <div class="col-xs-12"><?php probit_breadcrumb(); ?></div>
            <?php } ?>
        </div>
    </div>
</div>
<div class="container">
    <div class="row">
        <div id="content" role="main">
            <div class="col-xs-12">
                <div id="primary" class="posts_wrapper clearfix timeline_bg">
                    <?php
                    global $wp_query;
                    if (have_posts()) :
                        while (have_posts()) : the_post();
                            ?>
                            <div id="primary-<?php echo get_the_ID(); ?>" class="timeline blog-wrap">
                                <div class="date_wrapper">
                                    <div class="date">
                                        <span class="year"><?php echo esc_html(get_the_date("d")); ?></span>
                                        <span class="month"><?php echo esc_html(get_the_date("M Y")); ?></span>
                                    </div>
                                </div>
                                <div class="post_wrapper box-blog">
                                    <?php if (has_post_thumbnail()) { ?>
                                        <div class="photo">
                                            <a class="" href="<?php the_permalink(); ?>">
                                                <?php
                                                if (has_post_thumbnail())
                                                    the_post_thumbnail();
                                                else
                                                    echo '<img alt="' . esc_attr(get_the_title()) . '" src="' . esc_url(get_template_directory_uri() . '/images/no_image_600.png') . '" />';

                                                if (is_sticky()) :
                                                    ?>
                                                    <div class="featured-post-timeline">
                                                        <?php _e('Featured post', 'probit'); ?>
                                                    </div>
                                                    <?php
                                                endif;
                                                ?>
                                            </a>
                                        </div><?php
                                    }
                                    ?>
                                    <div class="desc col-xs-12">
                                        <a class="desc_content" href="<?php the_permalink(); ?>">
                                            <span class="post-icon">
                                                <i class="fa fa-pencil"></i> 
                                            </span>
                                        </a>
                                        <div class="entry-meta text-center">

                                        </div><!-- .entry-meta -->
                                        <a href="<?php the_permalink(); ?>">
                                            <?php the_title('<h3 class="entry-title text-center text-capitalize">', '</h3>'); ?>
                                        </a>
                                        <div class="inside">
                                            <p>
                                                <?php
                                                $content = wp_trim_excerpt();
                                                echo $trimmed_content = wp_trim_words($content, 50, ' &hellip;');
                                                ?>
                                            </p>
                                        </div>

                                    </div>
                                    <footer class="blog_footer text-capitalize">
                                        <span title="Posted By <?php echo esc_attr(get_the_author()); ?>"><i class="fa fa-user"></i><?php echo esc_attr(get_the_author()); ?></span>
                                        <?php
                                        if (comments_open()) :
                                            comments_popup_link('<span class="leave-reply"><i class="fa fa-comment"></i>0</span>', '<span class="leave-reply"><i class="fa fa-comment"></i>1</span>', '<span class="leave-reply"><i class="fa fa-comment"></i>%</span>');
                                        endif; // comments_open()

                                        if ('post' == get_post_type()) {
                                            // Translators: used between list items, there is a space after the comma.
                                            $categories_list = get_the_category_list(', ');

                                            // Translators: used between list items, there is a space after the comma.
                                            $tag_list = get_the_tag_list('', ', ');

                                            if ($categories_list != "") {
                                                ?>
                                                <span class="probit-timeline"><i class="fa fa-bookmark"></i><?php echo $categories_list; ?></span>
                                                <?php
                                            }

                                            if ($tag_list != "") {
                                                ?>
                                                <span class="probit-timeline"><i class="fa fa-tag"></i><?php echo $tag_list; ?></span>
                                                <?php
                                            }
                                        }
                                        ?>
                                        <div class="read_more">
                                            <a class="btn-more primary-btn" href="<?php the_permalink(); ?>"><i class="fa fa-plus"></i><?php _e('Read More', 'probit'); ?></a>
                                        </div>
                                    </footer>
                                </div>
                            </div>
                            <?php
                        endwhile;
                        ?>
                        <div class="col-xs-12 padding_0">
                            <?php
                            // Previous/next page navigation.
                            probit_paging_nav();
                            ?>
                        </div>
                        <?php
                    endif;
                    wp_reset_postdata();
                    ?>
                </div>
            </div><!-- .row -->
        </div><!-- #content -->
    </div><!-- .row -->
</div><!-- .container -->
<?php get_footer(); ?>