2016-11-17 21:18:39 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2016-11-19 17:43:22 +00:00
|
|
|
* Card patrial template responsible to show individual posts in home.php page.
|
|
|
|
*
|
2016-11-17 21:18:39 +00:00
|
|
|
* @package understrap
|
|
|
|
*/
|
2016-11-19 17:43:22 +00:00
|
|
|
|
2016-11-17 21:18:39 +00:00
|
|
|
?>
|
|
|
|
<div class="card">
|
|
|
|
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
|
|
|
|
|
|
|
|
<header class="entry-header">
|
2016-11-19 17:43:22 +00:00
|
|
|
<?php if ( has_post_thumbnail() ) : ?>
|
2016-11-17 21:18:39 +00:00
|
|
|
<?php
|
|
|
|
$alt = get_post_meta( get_post_thumbnail_id( $post->ID ), '_wp_attachment_image_alt', true );
|
|
|
|
?>
|
|
|
|
<img src="<?php echo get_the_post_thumbnail_url( $post->ID, 'large' ); ?>"
|
|
|
|
alt="<?php echo $alt; ?>"
|
|
|
|
class="card-img-top img-fluid">
|
|
|
|
<?php endif; ?>
|
|
|
|
<div class="card-block">
|
|
|
|
<?php the_title( sprintf( '<h2 class="entry-title card-title"><a href="%s" rel="bookmark">',
|
|
|
|
esc_url( get_permalink() ) ), '</a></h2>' ); ?>
|
|
|
|
|
|
|
|
<?php if ( 'post' === get_post_type() ) : ?>
|
|
|
|
|
|
|
|
<div class="entry-meta">
|
|
|
|
<p class="card-text"> <?php understrap_posted_on(); ?> </p>
|
|
|
|
</div><!-- .entry-meta -->
|
|
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
</header><!-- .entry-header -->
|
|
|
|
|
|
|
|
<div class="card-block">
|
|
|
|
<div class="entry-content card-text">
|
|
|
|
<?php
|
|
|
|
echo understrap_excerpt_with_length( $post->ID, 15 );
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
wp_link_pages( array(
|
|
|
|
'before' => '<div class="page-links">' . __( 'Pages:', 'understrap' ),
|
|
|
|
'after' => '</div>',
|
|
|
|
) );
|
|
|
|
?>
|
|
|
|
</div><!-- .entry-content -->
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</article><!-- #post-## -->
|
|
|
|
</div>
|