';
- foreach ($links as $contact):
- $icon_key = isset($contact['icon']) ? $contact['icon'] : '';
-
- // 旧数据兼容:从 name 猜测 icon_key
- if (!$icon_key) {
- $name_lower = strtolower(isset($contact['name']) ? $contact['name'] : '');
- $guess = array(
- 'github' => 'github', 'google' => 'google', 'x' => 'x', 'twitter' => 'x',
- 'email' => 'email', 'wechat' => 'wechat', 'qq' => 'qq', 'weibo' => 'weibo',
- 'telegram' => 'telegram', 'discord' => 'discord', 'bilibili' => 'bilibili',
- 'linkedin' => 'linkedin', 'facebook' => 'facebook', 'youtube' => 'youtube',
- 'instagram' => 'instagram', 'rss' => 'web', 'site' => 'web', 'globe' => 'web',
- );
- foreach ($guess as $k => $v) {
- if (strpos($name_lower, $k) !== false) { $icon_key = $v; break; }
- }
- if (!$icon_key) $icon_key = 'web';
- }
-
- $title = aksrt_icon_key_to_name($icon_key);
- $svg = aksrt_inline_svg($icon_key);
- if (!$svg) $svg = aksrt_inline_svg('web');
- if (!$svg) continue;
-
- printf(
- '
%s',
- esc_url($contact['url']),
- esc_attr($title),
- $svg
- );
- endforeach;
- echo '
';
-}
-endif;
-
-// ============================================================
-// Head 输出(Favicon / Canonical / SEO / OpenGraph / Twitter / JSON-LD / robots)
-// ------------------------------------------------------------
-// Phase 7:上述 head 输出已统一收口到 AKSRT_SEO_Head(单一装配器,
-// 见 inc/classes/class-aksrt-seo-head.php 与 seo-output-matrix.md),
-// 不再在此用多个分散的 wp_head 闭包输出,避免重复与来源不可追踪。
-// ============================================================
-
-// ============================================================
-// Sitemap:兼容历史 aksrt_resource CPT(v3.4 起资源已并入 post,无需特殊处理)
-// ============================================================
-add_filter('wp_sitemaps_post_types', function ($post_types) {
- if (post_type_exists('aksrt_resource') && !isset($post_types['aksrt_resource'])) {
- $post_types['aksrt_resource'] = get_post_type_object('aksrt_resource');
- }
- // 移除内部隐藏的 banner CPT(虽然其 public=false,但兜底)
- if (isset($post_types['aksrt_banner'])) {
- unset($post_types['aksrt_banner']);
- }
- return $post_types;
-});
-
-// ============================================================
-// 模板标签函数(供 index.php / single.php / archive.php 使用)
-// ============================================================
-
-if (!function_exists('aksrt_post_categories')):
-/**
- * 显示文章分类标签
- * 定义在 functions.php 中,确保所有模板都能调用
- */
-function aksrt_post_categories() {
- $categories = get_the_category_list(array(
- 'separator' => '',
- 'before' => '