Permalink
Browse files

Updated page-blog.php template file to include conditional display of…

… post-thumbnail.
  • Loading branch information...
1 parent d0db007 commit ed13c77adc57be467f0573dd047b37ed2ce954b8 Rachel Baker committed Jun 3, 2013
Showing with 47 additions and 36 deletions.
  1. +47 −36 templates-pages/page-blog.php
@@ -7,55 +7,66 @@
* @subpackage BootstrapWP
*/
get_header(); ?>
-<?php while (have_posts()) : the_post(); ?>
-
- <div class="container">
- <div class="row">
- <div class="span12">
- <?php if (function_exists('bootstrapwp_breadcrumbs')) {
- bootstrapwp_breadcrumbs();
- } ?>
- </div><!--/.span12 -->
- </div><!--/.row -->
-
- <header class="page-title">
- <h1><?php the_title();?></h1>
- </header>
-
- <div class="row content">
+<div class="container">
+ <div class="row">
+ <div class="span12">
+ <?php if (function_exists('bootstrapwp_breadcrumbs')) {
+ bootstrapwp_breadcrumbs();
+ } ?>
+ </div>
+ </div><!--/.row -->
+
+ <div class="row content">
<div class="span8">
- <?php the_content(); ?>
- <?php endwhile;
- // reset the loop
- wp_reset_query(); ?>
- <hr/>
+ <?php while (have_posts()) : the_post(); ?>
+ <header class="page-title">
+ <h1><?php the_title();?></h1>
+ </header>
+
+ <?php the_content(); ?>
+ <hr/>
+
+ <?php // reset the loop
+ endwhile;
+ wp_reset_query(); ?>
- <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
- // Blog post query
- query_posts(array('post_type' => 'post', 'paged' => $paged, 'showposts' => 0));
- if (have_posts()) : while (have_posts()) : the_post(); ?>
+ <?php // Blog post query
+ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
+ query_posts(array('post_type' => 'post', 'paged' => $paged, 'showposts' => 0));
+ if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>">
- <h3><?php the_title();?></h3></a>
+ <h3><?php the_title();?></h3>
+ </a>
<p class="meta">
<?php echo bootstrapwp_posted_on();?>
</p>
<div class="row">
- <div class="span2">
- <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
- <?php echo bootstrapwp_autoset_featured_img(); ?></a>
- </div><!-- /.span2 -->
- <div class="span6">
- <?php the_excerpt();?>
- </div><!-- /.span6 -->
+ <?php // Post thumbnail conditional display.
+ if ( bootstrapwp_autoset_featured_img() !== false ) : ?>
+ <div class="span2">
+ <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute( 'echo=0' ); ?>">
+ <?php echo bootstrapwp_autoset_featured_img(); ?>
+ </a>
+ </div>
+ <div class="span6">
+ <?php else : ?>
+ <div class="span8">
+ <?php endif; ?>
+ <?php the_excerpt(); ?>
+ </div>
</div><!-- /.row -->
+
<hr/>
</div><!-- /.post_class -->
- <?php endwhile; endif; ?>
- <?php bootstrapwp_content_nav('nav-below'); ?>
- </div><!-- /.span8 -->
+
+ <?php // end of blog post loop.
+ endwhile; endif; ?>
+
+ <?php bootstrapwp_content_nav('nav-below');?>
+ </div>
<?php get_sidebar('blog'); ?>
<?php get_footer(); ?>

0 comments on commit ed13c77

Please sign in to comment.