initial loop of posts and single

This commit is contained in:
Fabiano Alencar 2018-02-22 15:04:50 -03:00
parent b4fba3244a
commit 11e2860a5d
2 changed files with 28 additions and 9 deletions

View File

@ -1,6 +1,11 @@
<?php
//Header
get_header();
<?php get_header(); ?>
//Footer
get_footer();
<div class="container-fluid">
<div class="row p-2">
<?php get_template_part( 'template-parts/loop' ); ?>
</div>
</div>
<?php get_footer();

View File

@ -1,6 +1,20 @@
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="<?php if(!is_single()) : echo 'card-columns'; endif; ?>">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-sm">
<div class="card w-100">
<h5 class="card-header"><?php the_title(); ?></h5>
<div class="card-body">
<p class="card-text"><?php if(is_single()) : the_content(); else : the_excerpt(); endif; ?></p>
<a href="<?php the_permalink(); ?>" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
<nav class="mx-auto">
</nav>