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

45 lines
979 B
PHP
Raw Normal View History

2016-11-20 11:09:16 +00:00
<?php
/**
* Partial template to display latest posts (home.php) as grid.
*
* @package understrap
*/
?>
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
<div class="col-md-4 col-xs-12">
<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>