Skip to content

Instantly share code, notes, and snippets.

@FinalDestiny
Created February 22, 2018 00:52
Show Gist options
  • Save FinalDestiny/9be59f22e98ae756a72b354ad6bc4b4b to your computer and use it in GitHub Desktop.
Save FinalDestiny/9be59f22e98ae756a72b354ad6bc4b4b to your computer and use it in GitHub Desktop.
<?php
$related_posts = extra_get_post_related_posts();
if ( $related_posts && extra_is_post_related_posts() ) { ?>
<div class="et_extra_other_module related-posts">
<div class="related-posts-header">
<h3><?php esc_html_e( 'Related Posts', 'extra' ); ?></h3>
</div>
<div class="related-posts-content clearfix">
<?php while ( $related_posts->have_posts() ) : $related_posts->the_post(); ?>
<div class="related-post">
<div class="featured-image"><?php
echo et_extra_get_post_thumb( array(
'size' => 'extra-image-small',
'a_class' => array('post-thumbnail'),
'post_format_thumb_fallback' => true,
'img_after' => '<span class="et_pb_extra_overlay"></span>',
));
?></div>
<h4 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<p class="date"><?php extra_the_post_date(); ?></p>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment