Skip to content

Instantly share code, notes, and snippets.

@bacoords
Created January 15, 2022 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bacoords/b9c289e63215b688a99dead6759f4590 to your computer and use it in GitHub Desktop.
Save bacoords/b9c289e63215b688a99dead6759f4590 to your computer and use it in GitHub Desktop.
Understrap post content with card classes
<?php
/**
* Post rendering content according to caller of get_template_part
*
* @package Understrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>
<article <?php post_class( 'card' ); ?> id="post-<?php the_ID(); ?>">
<header class="entry-header card-header">
<?php
the_title(
sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ),
'</a></h2>'
);
?>
<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
<?php understrap_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<?php echo get_the_post_thumbnail( $post->ID, 'large' ); ?>
<div class="entry-content card-body">
<?php
the_excerpt();
understrap_link_pages();
?>
</div><!-- .entry-content -->
<footer class="entry-footer card-footer">
<?php understrap_entry_footer(); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment