Created
March 7, 2017 19:54
-
-
Save shawnhooper/711a8a011630190a70701439011825fc to your computer and use it in GitHub Desktop.
Revisions
-
shawnhooper created this gist
Mar 7, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ <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>