ID : (int) get_queried_object_id(); $show_cat_id = get_post_meta($post_id, 'navs_show_cat_id', true); if (!is_array($show_cat_id)) { $show_cat_id = $show_cat_id !== '' && $show_cat_id !== null ? array_values(array_filter(array_map('intval', (array) $show_cat_id))) : []; } else { $show_cat_id = array_values(array_filter(array_map('intval', $show_cat_id))); } $page_desc = (string) get_post_meta($post_id, 'navs_page_desc', true); $page_name = (string) get_post_meta($post_id, 'navs_page_name', true); $title = get_the_title($post_id); $page_name = $page_name !== '' ? $page_name : $title; $all_cats = get_categories([ 'orderby' => 'term_group', 'order' => 'ASC', 'hide_empty' => false, ]); $can_admin = is_user_logged_in() && current_user_can('manage_options'); get_header(); ?>

[]

true]); } elseif (function_exists('aksrt_get_share_html')) { echo aksrt_get_share_html(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } ?>
(int) $c_id, 'numberposts' => -1, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'suppress_filters' => false, ]); if (empty($posts)) { continue; } $section_id = 'navs-cat-' . (int) $c_id; echo '
'; echo '

' . esc_html($the_cat->name) . '

'; echo '
    '; foreach ($posts as $p) { $time_tip = get_the_time('Y年m月d日 H:i', $p); $time_ago = human_time_diff(get_the_time('U', $p), current_time('timestamp')) . __('前', 'aksrt'); $views = function_exists('aksrt_get_post_views') ? (int) aksrt_get_post_views($p->ID) : 0; $likes = (int) get_post_meta($p->ID, 'like', true); if ($likes <= 0) { $likes = (int) get_post_meta($p->ID, 'aksrt_like', true); } $post_tip = sprintf( /* translators: 1: views 2: likes */ __('阅读(%1$s) 点赞(%2$s)', 'aksrt'), (string) $views, (string) $likes ); $subtitle = (string) get_post_meta($p->ID, 'subtitle', true); if ($subtitle === '') { $subtitle = (string) get_post_meta($p->ID, 'aksrt_subtitle', true); } echo '
  • '; echo '
  • '; } echo '
'; } } elseif ($can_admin) { echo '
'; echo '

' . esc_html__('尚未选择分类,请点击标题旁「设置」配置要展示的分类。', 'aksrt') . '

'; echo '
'; } else { echo '
'; echo '

' . esc_html__('暂无导航内容', 'aksrt') . '

'; echo '
'; } ?>