Files
wordpress-theme-aksrt/footer.php
T
kate522 8f19384582 fix(homepage): align shell with zibll and restore post stream
Move header-slider outside main, render fluid zones once, default the
latest stream to plain posts by date, and cut dual-render/perf waste so
published posts and hero/banner structure match the zibll contract.
2026-07-12 17:49:58 +08:00

493 lines
22 KiB
PHP

<?php
/**
* 站点页脚 — v4.0 Zibll-Inspired
*
* 新增功能:
* - 浮动右侧按钮组(回到顶部、主题切换、联系方式等)
* - 移动端底部 Tab 栏(首页/分类/用户/更多)
* - 文章页专用底部栏(点赞/收藏/分享/评论)
* - 统一消费 window.aksrtData 全局配置对象
*
* @package AKSRT
* @version 4.0.0
*/
defined('ABSPATH') || exit;
// 数据准备
$blog_name = function_exists('aksrt_get_site_logo_text') ? aksrt_get_site_logo_text() : get_bloginfo('name');
$blog_description = get_bloginfo('description', 'display');
$has_settings = class_exists('AKSRT_Settings');
$search_placeholder = function_exists('aksrt_get_search_placeholder') ? aksrt_get_search_placeholder() : __('开启精彩搜索', 'aksrt');
$search_hot_keywords = function_exists('aksrt_get_search_hot_keywords') ? aksrt_get_search_hot_keywords() : [];
$search_history_enabled = function_exists('aksrt_search_history_enabled') ? aksrt_search_history_enabled() : true;
$search_suggest_enabled = function_exists('aksrt_search_suggestions_enabled') ? aksrt_search_suggestions_enabled() : false;
// 联系图标 / 社交链接
$footer_contacts = $has_settings ? AKSRT_Settings::get_footer_contacts() : [];
if (empty($footer_contacts) && function_exists('aksrt_get_about_info')) {
$about = aksrt_get_about_info();
$footer_contacts = $about['contacts'] ?? [];
}
// 友情链接
$friend_links = aksrt_get_friend_links();
// 快速链接
$quick_links = $has_settings ? AKSRT_Settings::get_quick_links() : [];
// 更多链接
$more_links = $has_settings ? AKSRT_Settings::get_more_links() : [];
// 热门分类数量
$hot_cat_count = $has_settings ? AKSRT_Settings::get_hot_categories_count() : 5;
// 备案信息(统一 page-display footer schema + 全局设置)
$filing = $has_settings ? AKSRT_Settings::get_filing_settings() : ['icp_enabled' => true, 'icp_number' => '', 'police_enabled' => true, 'police_number' => ''];
$icp_number = $filing['icp_enabled'] ? $filing['icp_number'] : '';
$police_number = $filing['police_enabled'] ? $filing['police_number'] : '';
$footer_text = $has_settings ? AKSRT_Settings::footer_text() : '';
// 版权文案
$copyright_text = $has_settings ? AKSRT_Settings::get_copyright_text() : '';
// 页脚布局模板
$footer_layout = $has_settings ? AKSRT_Settings::get_footer_layout_template() : 'default';
// §2.3 三列结构化字段
$footer_brand = $has_settings ? AKSRT_Settings::get_footer_brand_settings() : ['m_s' => ['pc', 'mobile'], 'img' => '', 'img_dark' => '', 'title' => '', 'custom_code' => ''];
$footer_contact_ext = $has_settings ? AKSRT_Settings::get_footer_contact_extended_settings() : ['m_s' => ['pc', 'mobile'], 'wechat_img' => '', 'qq' => '', 'weibo' => '', 'email' => '', 'more' => [], 'code_1' => '', 'code_2' => ''];
$footer_mini = $has_settings ? AKSRT_Settings::get_footer_mini_img_settings() : ['m_s' => ['pc', 'mobile'], 'items' => []];
$footer_customize_code = $has_settings ? AKSRT_Settings::get_footer_customize_code() : '';
// 品牌列设备可见性
$_brand_show_pc = in_array('pc', $footer_brand['m_s'], true);
$_brand_show_sm = in_array('mobile', $footer_brand['m_s'], true);
$_brand_vis_cls = '';
if ($_brand_show_pc && !$_brand_show_sm) $_brand_vis_cls = ' hide-on-mobile';
elseif (!$_brand_show_pc && $_brand_show_sm) $_brand_vis_cls = ' hide-on-desktop';
// 联系区设备可见性
$_contact_show_pc = in_array('pc', $footer_contact_ext['m_s'], true);
$_contact_show_sm = in_array('mobile', $footer_contact_ext['m_s'], true);
$_contact_vis_cls = '';
if ($_contact_show_pc && !$_contact_show_sm) $_contact_vis_cls = ' hide-on-mobile';
elseif (!$_contact_show_pc && $_contact_show_sm) $_contact_vis_cls = ' hide-on-desktop';
// 二维码组设备可见性
$_mini_show_pc = in_array('pc', $footer_mini['m_s'], true);
$_mini_show_sm = in_array('mobile', $footer_mini['m_s'], true);
$_mini_vis_cls = '';
if ($_mini_show_pc && !$_mini_show_sm) $_mini_vis_cls = ' hide-on-mobile';
elseif (!$_mini_show_pc && $_mini_show_sm) $_mini_vis_cls = ' hide-on-desktop';
/**
* 渲染快速链接 URL:支持外链 / 站内相对路径
*/
$render_link_url = function ($raw) {
if (empty($raw)) return '#';
if (strpos($raw, 'http') === 0) return esc_url($raw);
return esc_url(home_url($raw));
};
?>
<?php if (is_active_sidebar('single_bottom_fluid') && is_singular()) : ?>
<div class="fluid-widget-wrap">
<?php dynamic_sidebar('single_bottom_fluid'); ?>
</div>
<?php endif; ?>
<?php if (is_active_sidebar('archive_bottom_fluid') && (is_archive() || is_search())) : ?>
<div class="fluid-widget-wrap">
<?php dynamic_sidebar('archive_bottom_fluid'); ?>
</div>
<?php endif; ?>
<footer class="footer site-footer--<?php echo esc_attr($footer_layout); ?>" data-aksrt-shell="site-footer" role="contentinfo">
<?php if (is_active_sidebar('all_footer')) : ?>
<div class="site-footer__widgets container-footer">
<?php dynamic_sidebar('all_footer'); ?>
</div>
<?php endif; ?>
<?php
$_has_brand = !empty($footer_brand['img']) || !empty($footer_brand['title']) || !empty($footer_brand['custom_code']);
$_has_contact = !empty($footer_contacts) || !empty($footer_contact_ext['wechat_img']) || !empty($footer_contact_ext['qq']) || !empty($footer_contact_ext['email']) || !empty($footer_contact_ext['more']);
$_has_links = !empty($quick_links) || !empty($more_links);
$_has_mini = !empty($footer_mini['items']);
$_has_grid = $_has_brand || $_has_contact || $_has_links || $_has_mini;
?>
<?php if ($_has_grid) : ?>
<div class="site-footer__inner">
<div class="site-footer__grid row">
<?php if ($_has_brand) : ?>
<div class="site-footer__brand col-lg-4 col-md-6<?php echo esc_attr($_brand_vis_cls); ?>">
<?php if (!empty($footer_brand['img'])) : ?>
<img class="site-footer__logo site-footer__logo--day" src="<?php echo esc_url($footer_brand['img']); ?>" alt="<?php echo esc_attr($blog_name); ?>">
<?php if (!empty($footer_brand['img_dark'])) : ?>
<img class="site-footer__logo site-footer__logo--night" src="<?php echo esc_url($footer_brand['img_dark']); ?>" alt="<?php echo esc_attr($blog_name); ?>">
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($footer_brand['title'])) : ?>
<h4 class="site-footer__title"><?php echo esc_html($footer_brand['title']); ?></h4>
<?php endif; ?>
<p class="site-footer__desc"><?php echo esc_html($blog_description); ?></p>
<?php if (!empty($footer_contacts)) : ?>
<div class="social-row">
<?php foreach ($footer_contacts as $contact) :
$c_icon = $contact['icon'] ?? '';
$c_url = $contact['url'] ?? '#';
$c_label = $contact['title'] ?? ($contact['label'] ?? aksrt_icon_key_to_name($c_icon));
$c_svg = function_exists('aksrt_inline_svg') ? aksrt_inline_svg($c_icon) : '';
?>
<a href="<?php echo esc_url($c_url); ?>" target="_blank" rel="noopener noreferrer" aria-label="<?php echo esc_attr($c_label); ?>" title="<?php echo esc_attr($c_label); ?>">
<?php if ($c_svg !== '') : ?>
<?php echo $c_svg; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<i class="fas fa-globe" aria-hidden="true"></i>
<?php endif; ?>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if (!empty($footer_brand['custom_code'])) : ?>
<div class="site-footer__brand-code"><?php echo wp_kses_post($footer_brand['custom_code']); ?></div>
<?php endif; ?>
<?php if (!empty($friend_links)) : ?>
<div class="site-footer__friends">
<h5 class="site-footer__friends-title"><?php esc_html_e('友情链接', 'aksrt'); ?></h5>
<div class="site-footer__friends-list">
<?php foreach ($friend_links as $fl) : ?>
<a href="<?php echo esc_url($fl['url'] ?? '#'); ?>" target="_blank" rel="noopener noreferrer nofollow"><?php echo esc_html($fl['name'] ?? ''); ?></a>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($_has_links) : ?>
<?php if (!empty($quick_links)) : ?>
<div class="site-footer__col col-lg-2 col-md-3 col-6">
<h5 class="site-footer__title"><?php esc_html_e('快速链接', 'aksrt'); ?></h5>
<ul>
<?php foreach ($quick_links as $ql) : ?>
<li><a href="<?php echo esc_url($render_link_url($ql['url'] ?? '')); ?>"><?php echo esc_html($ql['name'] ?? $ql['label'] ?? ''); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (!empty($more_links)) : ?>
<div class="site-footer__col col-lg-2 col-md-3 col-6">
<h5 class="site-footer__title"><?php esc_html_e('更多', 'aksrt'); ?></h5>
<ul>
<?php foreach ($more_links as $ml) : ?>
<li><a href="<?php echo esc_url($render_link_url($ml['url'] ?? '')); ?>"><?php echo esc_html($ml['name'] ?? $ml['label'] ?? ''); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['wechat_img']) || !empty($footer_contact_ext['qq']) || !empty($footer_contact_ext['email'])) : ?>
<div class="site-footer__col col-lg-2 col-md-6<?php echo esc_attr($_contact_vis_cls); ?>">
<h5 class="site-footer__title"><?php esc_html_e('联系我们', 'aksrt'); ?></h5>
<ul>
<?php if (!empty($footer_contact_ext['email'])) : ?>
<li><i class="fas fa-envelope" aria-hidden="true"></i> <?php echo esc_html($footer_contact_ext['email']); ?></li>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['qq'])) : ?>
<li><i class="fab fa-qq" aria-hidden="true"></i> QQ: <?php echo esc_html($footer_contact_ext['qq']); ?></li>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['weibo'])) : ?>
<li><i class="fab fa-weibo" aria-hidden="true"></i> <?php echo esc_html($footer_contact_ext['weibo']); ?></li>
<?php endif; ?>
</ul>
<?php if (!empty($footer_contact_ext['wechat_img'])) : ?>
<div class="site-footer__mini-qr">
<div class="site-footer__mini-qr-item">
<img src="<?php echo esc_url($footer_contact_ext['wechat_img']); ?>" alt="<?php esc_attr_e('微信', 'aksrt'); ?>">
<span><?php esc_html_e('微信', 'aksrt'); ?></span>
</div>
</div>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['code_1'])) : ?>
<div class="site-footer__contact-code"><?php echo wp_kses_post($footer_contact_ext['code_1']); ?></div>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['code_2'])) : ?>
<div class="site-footer__contact-code"><?php echo wp_kses_post($footer_contact_ext['code_2']); ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($_has_mini) : ?>
<div class="site-footer__col col-lg-2 col-md-6<?php echo esc_attr($_mini_vis_cls); ?>">
<h5 class="site-footer__title"><?php esc_html_e('关注我们', 'aksrt'); ?></h5>
<div class="site-footer__mini-qr">
<?php foreach ($footer_mini['items'] as $mi) : ?>
<div class="site-footer__mini-qr-item">
<img src="<?php echo esc_url($mi['img'] ?? ''); ?>" alt="<?php echo esc_attr($mi['label'] ?? ''); ?>">
<?php if (!empty($mi['label'])) : ?>
<span><?php echo esc_html($mi['label']); ?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if ($hot_cat_count > 0) : ?>
<?php
$_hot_cache_key = 'aksrt_footer_hot_cats_' . (int) $hot_cat_count;
$_hot_cats = wp_cache_get($_hot_cache_key, 'aksrt');
if (!is_array($_hot_cats)) {
$_hot_cats = get_categories(['orderby' => 'count', 'order' => 'DESC', 'number' => $hot_cat_count, 'hide_empty' => true]);
if (!is_array($_hot_cats)) {
$_hot_cats = [];
}
wp_cache_set($_hot_cache_key, $_hot_cats, 'aksrt', 12 * HOUR_IN_SECONDS);
}
if (!empty($_hot_cats)) :
?>
<div class="site-footer__col col-lg-2 col-md-3 col-6">
<h5 class="site-footer__title"><?php esc_html_e('热门分类', 'aksrt'); ?></h5>
<ul>
<?php foreach ($_hot_cats as $hc) : ?>
<li><a href="<?php echo esc_url(get_category_link($hc->term_id)); ?>"><?php echo esc_html($hc->name); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<div class="container-fluid container-footer">
<?php if (!empty($icp_number) || !empty($police_number)) : ?>
<div class="site-footer__filings">
<?php if (!empty($icp_number)) : ?>
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer nofollow">
<?php echo esc_html($icp_number); ?>
</a>
<?php endif; ?>
<?php if (!empty($police_number)) : ?>
<a href="https://beian.mps.gov.cn/" target="_blank" rel="noopener noreferrer nofollow">
<?php echo esc_html($police_number); ?>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<p class="site-footer__copyright">
&copy; <?php echo esc_html(gmdate('Y')); ?>
<?php echo esc_html($blog_name); ?>.
<?php
if (!empty($copyright_text)) {
echo wp_kses_post($copyright_text);
} else {
esc_html_e('由 WordPress 强力驱动。', 'aksrt');
}
?>
</p>
<?php if ($footer_text !== '') : ?>
<p class="site-footer__copyright site-footer__copyright--extra"><?php echo esc_html($footer_text); ?></p>
<?php endif; ?>
<?php if (!empty($footer_customize_code)) : ?>
<div class="site-footer__customize-code"><?php echo wp_kses_post($footer_customize_code); ?></div>
<?php endif; ?>
</div>
</footer>
<!-- 浮动右侧按钮组 -->
<?php
$floating_settings = $has_settings ? AKSRT_Settings::get_floating_buttons_settings() : [];
$floating_items = $has_settings ? AKSRT_Settings::get_floating_buttons_items() : [];
$floating_enabled = !empty($floating_settings['enabled']) && !empty($floating_items);
$tabbar_settings = $has_settings ? AKSRT_Settings::get_footer_tabbar_settings() : [];
$tabbar_items = $has_settings ? AKSRT_Settings::get_footer_tabbar_items() : [];
$tabbar_enabled = !empty($tabbar_settings['enabled']) && !empty($tabbar_items);
$floating_classes = 'float-right';
$floating_classes .= ' ' . (!empty($floating_settings['style']) ? sanitize_html_class($floating_settings['style']) : 'round');
$floating_classes .= !empty($floating_settings['position']) && $floating_settings['position'] === 'center' ? ' position-center' : ' position-bottom';
if (!empty($floating_settings['scroll_hide'])) {
$floating_classes .= ' scrolling-hide';
}
if (!empty($floating_settings['scroll_down_hide'])) {
$floating_classes .= ' scroll-down-hide';
}
if (empty($floating_settings['shadow'])) {
$floating_classes .= ' no-shadow';
}
if (empty($floating_settings['animation'])) {
$floating_classes .= ' no-animation';
}
$float_blur = is_array($floating_settings['filter_blur'] ?? null) ? $floating_settings['filter_blur'] : [];
if (in_array('pc', $float_blur, true)) {
$floating_classes .= ' has-blur-pc';
}
if (in_array('mobile', $float_blur, true)) {
$floating_classes .= ' has-blur-mobile';
}
if ($floating_enabled) :
?>
<div id="float-right-btns" class="<?php echo esc_attr($floating_classes); ?>">
<?php foreach ($floating_items as $item) :
$item_type = $item['type'] ?? 'custom';
$item_icon = $item['icon'] ?? 'fas fa-circle';
$item_text = $item['text'] ?? '';
$item_url = $item['link'] ?? '#';
$item_target = !empty($item['new_window']) ? ' target="_blank" rel="noopener noreferrer"' : '';
$item_color = $item['color'] ?? '';
$item_bg = $item['bg'] ?? '';
$pc_show = $item['pc_s'] ?? true;
$m_show = $item['m_s'] ?? true;
$item_class = 'float-btn';
$inline_styles = [];
if ($item_color !== '') { $inline_styles[] = '--this-color:' . esc_attr($item_color); }
if ($item_bg !== '') { $inline_styles[] = '--this-bg:' . esc_attr($item_bg); }
if (!$pc_show) { $item_class .= ' hide-on-pc'; }
if (!$m_show) { $item_class .= ' hide-on-mobile'; }
$style_attr = $inline_styles ? ' style="' . implode(';', $inline_styles) . '"' : '';
if ($item_type === 'back_top') :
$item_class .= ' ontop';
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" id="float-back-to-top" role="button" aria-label="<?php echo esc_attr($item_text ?: __('返回顶部', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
</a>
<?php elseif ($item_type === 'theme_mode') :
$item_class .= ' theme-toggle-btn';
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" data-action="toggle-theme" aria-label="<?php echo esc_attr($item_text ?: __('切换主题', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="fas fa-sun float-btn__icon-sun" aria-hidden="true"></i>
<i class="fas fa-moon float-btn__icon-moon" aria-hidden="true"></i>
</a>
<?php elseif ($item_type === 'service_wechat') :
$item_class .= ' service-wechat';
$wechat_img = $item['wechat_img'] ?? ($item['qrcode_img'] ?? '');
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('微信', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php if ($wechat_img) : ?>
<div class="hover-show-con">
<img src="<?php echo esc_url($wechat_img); ?>" alt="<?php esc_attr_e('微信二维码', 'aksrt'); ?>">
<?php if ($item_text !== '') : ?><p><?php echo esc_html($item_text); ?></p><?php endif; ?>
</div>
<?php endif; ?>
</a>
<?php elseif ($item_type === 'service_qq') :
$item_class .= ' service-qq';
$qq_number = $item['qq'] ?? '';
$qq_img = $item['qrcode_img'] ?? '';
?>
<a href="<?php echo $qq_number ? esc_url('https://wpa.qq.com/msgrd?v=3&uin=' . $qq_number . '&site=qq&menu=yes') : '#'; ?>" class="<?php echo esc_attr($item_class); ?>" role="button"<?php echo $qq_number ? ' target="_blank" rel="noopener noreferrer"' : ''; ?> aria-label="<?php echo esc_attr($item_text ?: 'QQ'); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php if ($qq_img || $qq_number) : ?>
<div class="hover-show-con">
<?php if ($qq_img) : ?>
<img src="<?php echo esc_url($qq_img); ?>" alt="QQ">
<?php endif; ?>
<?php if ($qq_number) : ?><p>QQ: <?php echo esc_html($qq_number); ?></p><?php endif; ?>
</div>
<?php endif; ?>
</a>
<?php elseif ($item_type === 'add') :
$item_class .= ' newadd-btns';
$add_items = is_array($item['add_items'] ?? null) ? $item['add_items'] : [];
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('发布', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php if (!empty($add_items)) : ?>
<div class="hover-show-con">
<div class="float-add-menu">
<?php foreach ($add_items as $sub) :
$sub_url = $sub['url'] ?? '#';
$sub_icon = $sub['icon'] ?? 'fas fa-plus';
$sub_text = $sub['text'] ?? '';
?>
<a href="<?php echo esc_url($sub_url); ?>" class="float-add-menu__item">
<i class="<?php echo esc_attr($sub_icon); ?>" aria-hidden="true"></i>
<span><?php echo esc_html($sub_text); ?></span>
</a>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</a>
<?php elseif ($item_type === 'qrcode') :
$item_class .= ' qrcode-btn';
?>
<a href="#" class="<?php echo esc_attr($item_class); ?>" role="button" aria-label="<?php echo esc_attr($item_text ?: __('二维码', 'aksrt')); ?>"<?php echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<div class="hover-show-con">
<div class="float-btn-qrcode" data-qrcode-url="<?php echo esc_attr(get_permalink() ?: home_url('/')); ?>"></div>
<?php if ($item_text !== '') : ?><p><?php echo esc_html($item_text); ?></p><?php endif; ?>
</div>
</a>
<?php else :
$hover_html = $item['hover'] ?? '';
$hover_width = (int) ($item['hover_width'] ?? 200);
?>
<a href="<?php echo esc_url($item_url ?: '#'); ?>" class="<?php echo esc_attr($item_class); ?>"<?php echo $item_target; echo $style_attr; ?>>
<i class="<?php echo esc_attr($item_icon); ?>" aria-hidden="true"></i>
<?php if ($hover_html !== '') : ?>
<div class="hover-show-con"<?php echo $hover_width !== 200 ? ' style="min-width:' . (int) $hover_width . 'px"' : ''; ?>>
<div class="float-right__html"><?php echo wp_kses_post($hover_html); ?></div>
</div>
<?php endif; ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($tabbar_enabled) : ?>
<div class="footer-tabbar-placeholder" aria-hidden="true"></div>
<nav id="footer-tabbar" class="footer-tabbar<?php echo !empty($tabbar_settings['animation']) ? ' has-animation' : ''; ?><?php echo !empty($tabbar_settings['scroll_down_hide']) ? ' scroll-down-hide' : ''; ?><?php echo empty($tabbar_settings['border']) ? ' no-border' : ''; ?><?php echo empty($tabbar_settings['shadow']) ? ' no-shadow' : ''; ?>" aria-label="<?php esc_attr_e('底部导航', 'aksrt'); ?>">
<?php foreach ($tabbar_items as $tab_item) :
$tab_type = sanitize_key((string) ($tab_item['type'] ?? 'custom'));
$tab_text = (string) ($tab_item['text'] ?? '');
$tab_icon = (string) ($tab_item['icon'] ?? 'fas fa-circle');
$tab_href = home_url('/');
if ($tab_type === 'category') {
$tab_href = get_post_type_archive_link('post') ?: home_url('/');
} elseif ($tab_type === 'auth') {
$tab_href = is_user_logged_in() ? aksrt_get_user_center_url() : aksrt_get_login_url();
} elseif ($tab_type === 'search') {
$tab_href = home_url('/');
}
?>
<a href="<?php echo esc_url($tab_href); ?>" class="tabbar-item" data-type="<?php echo esc_attr($tab_type); ?>">
<i class="<?php echo esc_attr($tab_icon); ?>" aria-hidden="true"></i>
<?php if (!empty($tabbar_settings['show_text'])) : ?><span><?php echo esc_html($tab_text); ?></span><?php endif; ?>
</a>
<?php endforeach; ?>
</nav>
<?php endif; ?>
<?php
// Global search panel (desktop header button + mobile tabbar search).
$aksrt_search_panel = AKSRT_DIR . '/templates/parts/search-panel.php';
if (is_readable($aksrt_search_panel)) {
include $aksrt_search_panel;
}
?>
<?php if (is_active_sidebar('all_bottom_fluid')) : ?>
<div class="fluid-widget-wrap">
<?php dynamic_sidebar('all_bottom_fluid'); ?>
</div>
<?php endif; ?>
<?php
// 弹窗登录/注册模板(仅未登录用户)
if (!is_user_logged_in() && file_exists(AKSRT_DIR . '/templates/parts/modal-auth.php')) {
include AKSRT_DIR . '/templates/parts/modal-auth.php';
}
?>
<?php wp_footer(); ?>
</html>