修复了一些小问题
This commit is contained in:
1 parent
1b4928d69b
commit
ed914d2eec
12 files changed
+339
-349
No files matched your search
@@ -100,41 +100,18 @@ if (!function_exists('aksrt_render_user_card_posts')) :
|
||||
$style = 'mini';
|
||||
}
|
||||
$posts = aksrt_user_card_query_posts($args);
|
||||
$show_empty = !empty($args['show_empty']);
|
||||
|
||||
if (!$posts) {
|
||||
if (!$show_empty) {
|
||||
return '';
|
||||
}
|
||||
return '<div class="user-card-posts mt10 muted-2-color em09 text-center">' .
|
||||
esc_html__('暂无更多文章', 'aksrt') .
|
||||
'</div>';
|
||||
return '';
|
||||
}
|
||||
|
||||
ob_start();
|
||||
echo '<div class="user-card-posts mt10">';
|
||||
if ($style === 'card') {
|
||||
echo '<div class="swiper-container more-posts swiper-scroll"><div class="swiper-wrapper">';
|
||||
foreach ($posts as $rp) {
|
||||
$thumb = get_the_post_thumbnail_url($rp, 'medium');
|
||||
$title = get_the_title($rp);
|
||||
$time = function_exists('aksrt_time_ago')
|
||||
? aksrt_time_ago((string) $rp->post_date)
|
||||
: human_time_diff((int) get_the_time('U', $rp), (int) current_time('timestamp')) . __('前', 'aksrt');
|
||||
$views = function_exists('aksrt_get_post_views') ? (int) aksrt_get_post_views($rp->ID) : 0;
|
||||
echo '<div class="swiper-slide mr10">';
|
||||
echo '<a class="aksrt-more-post-card" href="' . esc_url(get_permalink($rp)) . '">';
|
||||
if ($thumb) {
|
||||
echo '<span class="aksrt-more-post-card__thumb"><img' . aksrt_get_lazy_attr('lazy_posts_thumb', (string) $thumb, 'fit-cover') . ' alt="" decoding="async"></span>';
|
||||
}
|
||||
echo '<span class="aksrt-more-post-card__body">';
|
||||
echo '<span class="aksrt-more-post-card__title text-ellipsis">' . esc_html($title) . '</span>';
|
||||
echo '<span class="aksrt-more-post-card__meta muted-2-color em09">';
|
||||
echo '<item>' . esc_html($time) . '</item>';
|
||||
if ($views > 0) {
|
||||
echo '<item class="pull-right"><i class="fa fas fa-eye" aria-hidden="true"></i> ' . esc_html((string) $views) . '</item>';
|
||||
}
|
||||
echo '</span></span></a></div>';
|
||||
echo '<div class="swiper-slide mr10">' .
|
||||
aksrt_render_graphic_card_post($rp, ['class' => 'em09', 'cut' => 32]) .
|
||||
'</div>';
|
||||
}
|
||||
echo '</div><div class="swiper-button-prev"></div><div class="swiper-button-next"></div></div>';
|
||||
} else {
|
||||
@@ -146,7 +123,6 @@ if (!function_exists('aksrt_render_user_card_posts')) :
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>';
|
||||
return (string) ob_get_clean();
|
||||
}
|
||||
endif;
|
||||
Reference in new issue
Block a user