'far fa-calendar-alt', 'text' => get_the_date(), ]; } $author_meta_items[] = [ 'icon' => 'far fa-eye', 'text' => sprintf(__('浏览 %s', 'aksrt'), function_exists('aksrt_format_number') ? aksrt_format_number($views) : number_format_i18n($views)), ]; $author_meta_items[] = [ 'icon' => 'far fa-comment-dots', 'text' => sprintf(__('评论 %s', 'aksrt'), number_format_i18n($comment_count)), ]; if ($word_count > 0) { $author_meta_items[] = [ 'icon' => 'far fa-file-word', 'text' => sprintf(__('约 %s 字', 'aksrt'), number_format_i18n($word_count)), ]; } if ($reading_minutes > 0) { $author_meta_items[] = [ 'icon' => 'far fa-hourglass', 'text' => sprintf(_n('约 %d 分钟', '约 %d 分钟', $reading_minutes, 'aksrt'), $reading_minutes), ]; } $copyright_text = trim((string) ($single_settings['copyright_text'] ?? '')); if ($copyright_text === '') { $copyright_text = sprintf( __('本文由 %s 原创发布,转载请注明出处。', 'aksrt'), get_the_author() ); } $show_action_card = !empty($single_settings['like_enabled']) || !empty($single_settings['favorite_enabled']) || !empty($single_settings['share_enabled']) || !empty($single_settings['print_enabled']) || !empty($single_settings['pdf_export_enabled']); $has_sidebar_widgets = is_active_sidebar('sidebar-article'); $show_sidebar = $has_sidebar_widgets || $show_toc; $cover_breadcrumbs_html = ''; if (!empty($single_settings['breadcrumbs']) && function_exists('aksrt_breadcrumbs')) { ob_start(); aksrt_breadcrumbs($single_settings['breadcrumbs_home'] ?? ''); $cover_breadcrumbs_html = trim((string) ob_get_clean()); } $post_front_content = (string) ($single_settings['front_content'] ?? ''); $post_after_content = (string) ($single_settings['after_content'] ?? ''); $content_maxheight = !empty($single_settings['maxheight_enabled']) ? max(0, (int) ($single_settings['maxheight'] ?? 0)) : 0; $post_toc_title = __('文章目录', 'aksrt'); $post_toc_widget = ''; $post_toc_drawer = ''; $post_share_dropdown = ''; $post_reward_modal = ''; $post_episode_count = max(0, (int) get_post_meta($post_id, '_aksrt_featured_video_episode', true)); $post_slide_images = array_values(array_filter((array) ($single_settings['slide_images'] ?? []))); $author_card_html = ''; if (class_exists('AKSRT_Docs_Presenter')) { $docs_presenter = AKSRT_Docs_Presenter::get_instance(); if ($docs_presenter->is_docs_page($post_id)) { get_template_part('templates/pages/page-documentnav'); get_footer(); return; } } if (!empty($single_settings['share_enabled'])) { $post_share_dropdown = ''; } if (!empty($single_settings['rewards_enabled']) && !empty($single_settings['rewards_image'])) { $post_reward_modal = ''; } if ($show_toc) { $post_toc_widget = '

' . esc_html($post_toc_title) . '

    '; $post_toc_drawer = '' . '
    ' . ''; } if (function_exists('aksrt_get_user_dashboard_view')) { $author_dashboard = aksrt_get_user_dashboard_view((int) get_the_author_meta('ID'), ['viewer_id' => get_current_user_id()]); $author_recent_posts = is_array($author_dashboard['recent_posts'] ?? null) ? $author_dashboard['recent_posts'] : []; $author_card_stats = [ ['label' => __('文章', 'aksrt'), 'value' => (int) ($author_dashboard['post_count'] ?? 0)], ['label' => __('评论', 'aksrt'), 'value' => (int) ($author_dashboard['comment_count'] ?? 0)], ['label' => __('收藏', 'aksrt'), 'value' => (int) ($author_dashboard['favorite_count'] ?? 0)], ]; $author_card_html = '
    ' . '
    ' . '' . get_avatar((int) get_the_author_meta('ID'), 56, '', esc_attr(get_the_author())) . '' . '
    ' . esc_html(get_the_author()) . ''; $author_bio = trim((string) get_the_author_meta('description')); if ($author_bio !== '') { $author_card_html .= '

    ' . esc_html($author_bio) . '

    '; } $author_card_html .= '
    '; foreach ($author_card_stats as $stat) { $author_card_html .= '' . esc_html((string) $stat['value']) . ' ' . esc_html($stat['label']) . ''; } $author_card_html .= '
    '; if (!empty($author_recent_posts)) { $author_card_html .= '

    ' . esc_html__('最新文章', 'aksrt') . '

    '; } $author_card_html .= '
    '; } $post_status_badge = ''; $post_status = get_post_status($post_id); if ($post_status && $post_status !== 'publish') { $status_map = [ 'draft' => ['label' => __('草稿', 'aksrt'), 'class' => 'jb-yellow'], 'pending' => ['label' => __('待审核', 'aksrt'), 'class' => 'jb-red'], 'private' => ['label' => __('私密', 'aksrt'), 'class' => 'b-black opacity8'], 'future' => ['label' => __('定时发布', 'aksrt'), 'class' => 'c-blue'], ]; if (isset($status_map[$post_status])) { $post_status_badge = '' . esc_html($status_map[$post_status]['label']) . ''; } } ?>
    >

    0) : ?>
    $slide_url) : ?>
    <?php echo esc_attr(get_the_title()); ?>

    <?php echo esc_attr(get_the_title()); ?>

    '

    ', 'after' => '

    ', ]); ?>
    ©
    THE END
    get_post_type($post_id), 'post_status' => 'publish', 'post__not_in' => [$post_id], 'posts_per_page' => $related_count, 'ignore_sticky_posts' => true, ]; if (($single_settings['related_type'] ?? 'category') === 'tag') { $tag_ids = wp_get_post_terms($post_id, 'post_tag', ['fields' => 'ids']); if (!empty($tag_ids) && !is_wp_error($tag_ids)) { $related_args['tag__in'] = $tag_ids; } } else { $cat_ids = wp_get_post_terms($post_id, 'category', ['fields' => 'ids']); if (!empty($cat_ids) && !is_wp_error($cat_ids)) { $related_args['category__in'] = $cat_ids; } } $related_query = new WP_Query($related_args); if ($related_query->have_posts()) : ?>