1
|
<?php $related_posts = colormag_related_posts_function(); ?>
|
2
|
|
3
|
<?php if ( $related_posts->have_posts() ): ?>
|
4
|
|
5
|
<h4 class="related-posts-main-title"><i class="fa fa-thumbs-up"></i><span><?php _e('You May Also Like', 'colormag'); ?></span></h4>
|
6
|
|
7
|
<div class="related-posts clearfix">
|
8
|
|
9
|
<?php while ( $related_posts->have_posts() ) : $related_posts->the_post(); ?>
|
10
|
<div class="single-related-posts">
|
11
|
|
12
|
<?php if ( has_post_thumbnail() ): ?>
|
13
|
<div class="related-posts-thumbnail">
|
14
|
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
15
|
<?php the_post_thumbnail('colormag-featured-post-medium'); ?>
|
16
|
</a>
|
17
|
</div>
|
18
|
<?php endif; ?>
|
19
|
|
20
|
<div class="article-content">
|
21
|
|
22
|
<h3 class="entry-title">
|
23
|
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
24
|
</h3><!--/.post-title-->
|
25
|
|
26
|
<div class="below-entry-meta">
|
27
|
<?php
|
28
|
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
|
29
|
$time_string = sprintf( $time_string,
|
30
|
esc_attr( get_the_date( 'c' ) ),
|
31
|
esc_html( get_the_date() )
|
32
|
);
|
33
|
printf( __( '<span class="posted-on"><a href="%1$s" title="%2$s" rel="bookmark"><i class="fa fa-calendar-o"></i> %3$s</a></span>', 'colormag' ),
|
34
|
esc_url( get_permalink() ),
|
35
|
esc_attr( get_the_time() ),
|
36
|
$time_string
|
37
|
);
|
38
|
?>
|
39
|
<span class="byline"><span class="author vcard"><i class="fa fa-user"></i><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo get_the_author(); ?>"><?php echo coauthors_posts_links(null, null, null, null, false ); ?></a></span></span>
|
40
|
<span class="comments"><i class="fa fa-comment"></i><?php comments_popup_link( '0', '1', '%' );?></span>
|
41
|
</div>
|
42
|
|
43
|
</div>
|
44
|
|
45
|
</div><!--/.related-->
|
46
|
<?php endwhile; ?>
|
47
|
|
48
|
</div><!--/.post-related-->
|
49
|
<?php endif; ?>
|
50
|
|
51
|
<?php wp_reset_query(); ?>
|