Created
March 7, 2017 19:54
Star
You must be signed in to star a gist
This file contains 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
<div class="post-related col-xs-12 no-padding"> | |
<div class="relatedposts col-md-10 col-md-offset-1"> | |
<h3 class="relatedposts-title text-center">You might also like...</h3> | |
<?php | |
global $gemMightAlsoLike; | |
$recommended_posts = $gemMightAlsoLike->get_posts( get_the_ID() ); | |
foreach ($recommended_posts as $recommended_post): ?> | |
<div class="relatedposts-item col-xs-12 col-sm-4 col-md-4"> | |
<a href="<?php echo esc_url( $recommended_post->link ) ?>" rel="bookmark" class="relatedposts-image" style="<?php if( $recommended_post->hero_image_url !== false ): ?> background-image: url('<?php echo esc_url( $recommended_post->hero_image_url ); ?>'); <?php endif; ?>"></a> | |
<div class="relatedposts-item-title"> | |
<a href="<?php echo esc_url( $recommended_post->link ) ?>" rel="bookmark"><?php echo esc_html($recommended_post->title->rendered); ?></a> | |
</div> | |
<div class="post-summary"> | |
<?php echo $recommended_post->excerpt->rendered; ?> | |
</div> | |
<div class="author-name"> | |
<?php echo esc_html( $recommended_post->coauthors ); ?> | |
</div> | |
<div class="post-date"> | |
<?php echo date('M Y', strtotime($recommended_post->date)) ?> | |
</div> | |
</div> | |
<?php | |
endforeach; | |
?> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment