This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
understrap/loop-templates/content-grid.php

46 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2016-11-20 11:09:16 +00:00
<?php
/**
* Partial template to display latest posts (home.php) as grid.
*
* @package understrap
*/
2016-11-21 18:12:07 +00:00
2016-11-21 09:54:27 +00:00
$col = get_theme_mod( 'understrap_grid_post_columns' );
2016-11-20 11:09:16 +00:00
?>
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
2016-11-21 09:54:27 +00:00
<div class="col-md-<?php echo esc_html( $col ); ?> col-xs-12">
2016-11-20 11:09:16 +00:00
<div class="card card-inverse ">
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php $alt = get_post_meta( get_post_thumbnail_id( $post->ID ), '_wp_attachment_image_alt', true ); ?>
<img class="card-img "
src="<?php echo esc_html( get_the_post_thumbnail_url( $post->ID, 'large' ) ) ?>" alt="<?php echo esc_html( $alt ); ?>">
<div class="card-img-overlay">
<header class="entry-header">
<h4 class="card-title"><?php the_title(); ?></h4>
<?php if ( 'post' === get_post_type() ) : ?>
<p class="entry-meta card-text">
<small>Posted: <?php the_date(); ?> at: <?php the_time(); ?></small>
</p>
<?php endif; ?>
</header>
</div>
</article>
</div>
</div>
</a>