Created
January 15, 2022 20:27
-
-
Save bacoords/b9c289e63215b688a99dead6759f4590 to your computer and use it in GitHub Desktop.
Understrap post content with card classes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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