<?php
/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * For example, it puts together the home page when no home.php file exists.
 *
 * @link http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Probit
 *
 */
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 _e('Blog', 'probit'); ?></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="primary" class="col-sm-8 col-md-9 col-xs-12 blog_wrapper list-layout">
            <div id="content" role="main">
                <?php
                global $wp_query;
                if (have_posts()) {
                    /* Start the Loop */
                    while (have_posts()) : the_post();
                        get_template_part('content');
                    endwhile;

                    // Previous/next page navigation.
                    probit_paging_nav();
                } else {
                    ?>
                    <article id="post-0" class="post no-results not-found">
                        <?php
                        if (current_user_can('edit_posts')) {
                            // Show a different message to a logged-in user who can add posts.
                            ?>
                            <header class="entry-header">
                                <h1 class="entry-title"><?php _e('No posts to display', 'probit'); ?></h1>
                            </header>

                            <div class="entry-content">
                                <p><?php printf(__('Ready to publish your first post?', 'probit') . ' <a href="' . admin_url('post-new.php') . '">Get started here</a>.'); ?></p>
                            </div><!-- .entry-content -->

                            <?php
                        } else {
                            // Show the default message to everyone else.
                            ?>
                            <header class="entry-header">
                                <h1 class="entry-title"><?php _e('Nothing Found', 'probit'); ?></h1>
                            </header>

                            <div class="entry-content">
                                <p><?php _e('Apologies, but no results were found. Perhaps searching will help find a related post.', 'probit'); ?></p>
                                <?php get_search_form(); ?>
                            </div><!-- .entry-content -->
                            <?php
                        } // end current_user_can() check
                        ?>
                    </article><!-- #post-0 -->
                    <?php
                }
                ?>
            </div><!-- #content -->
        </div><!-- #primary -->
        <?php get_sidebar(); ?>
    </div><!-- .row -->
</div><!-- .container -->
<?php get_footer(); ?>