posts-single.php
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* Template for the profile single post
*
* This template can be overridden by copying it to yourtheme/ultimate-member/profile/posts-single.php
*
* Page: "Profile"
*
* @version 2.6.1
*
* @var object $post
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
<div class="um-item">
<div class="um-item-link">
<i class="um-icon-ios-paper"></i>
<a href="<?php echo esc_url( get_permalink( $post ) ); ?>"><?php echo get_the_title( $post ); ?></a>
</div>
<?php if ( has_post_thumbnail( $post->ID ) ) {
$image_id = get_post_thumbnail_id( $post->ID );
$image_url = wp_get_attachment_image_src( $image_id, 'full', true ); ?>
<div class="um-item-img">
<a href="<?php echo esc_url( get_permalink( $post ) ); ?>">
<?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?>
</a>
</div>
<?php } ?>
<div class="um-item-meta">
<span>
<?php
// translators: %s: years.
printf( __( '%s ago', 'ultimate-member' ), human_time_diff( get_the_time( 'U', $post->ID ), current_time( 'timestamp' ) ) );
?>
</span>
<span>
<?php _e( 'in', 'ultimate-member' ); ?>: <?php the_category( ', ', '', $post->ID ); ?>
</span>
<span>
<?php $num_comments = get_comments_number( $post->ID );
if ( $num_comments == 0 ) {
$comments = __( 'no comments', 'ultimate-member' );
} elseif ( $num_comments > 1 ) {
// translators: %s: coments number.
$comments = sprintf( __( '%s comments', 'ultimate-member' ), $num_comments );
} else {
$comments = __( '1 comment', 'ultimate-member' );
} ?>
<a href="<?php echo esc_url( get_comments_link( $post->ID ) ); ?>"><?php echo $comments; ?></a>
</span>
</div>
</div>