<?php global $redux_demo;?>
<div class="related-wrapper">
    <?php
	$cats = wp_get_post_categories($post->ID);
    if ($cats) {
    $first_cat = $cats[0];
    $args=array(
      'cat' => $first_cat, 
      'post__not_in' => array($post->ID),
	  'orderby' => 'rand',
      'showposts'=>4,
      'ignore_sticky_posts'=>1
    );
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
	?> 
	<div class="related-maintitle">
        <?php esc_html_e('Related Post', 'efpose'); ?>
    </div>
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    <div class="related-subwrapper">
        <div class="related-thumb">
            <?php the_post_thumbnail('excerpt-thumbnail'); ?>
        </div>
        <div class="module4-meta"><?php echo esc_html (get_the_date()); ?></div>
        <div class="related-title">
			<a href="<?php the_permalink();?>"><?php the_title(); ?></a>
		</div>
    </div>
    <?php endwhile; } } 
  wp_reset_query();  
  ?>
</div>