fix(shell): fine-tune header/footer to zibll contracts

Move nav-fixed to body, apply show-slide overlay tokens, rebuild footer
as zibll template_1 list-inline (logo/links/contact/mini + footer-conter),
and align navbar brand/logo/menu spacing with zibll main.css.
This commit is contained in:
kate522 committed 2026-07-12 18:54:03 +08:00
1 parent ecba297700
commit 07e1b64951
4 files changed
+498 -206

No files matched your search

+159 -178
View File
@@ -105,200 +105,181 @@ $render_link_url = function ($raw) {
<footer class="footer site-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">
<div class="site-footer__widgets">
<?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_brand = !empty($footer_brand['img']) || !empty($footer_brand['title']) || !empty($footer_brand['custom_code']) || $blog_description !== '';
$_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']) || !empty($footer_contact_ext['weibo']);
$_has_links = !empty($quick_links) || !empty($more_links) || !empty($friend_links);
$_has_mini = !empty($footer_mini['items']);
$_has_grid = $_has_brand || $_has_contact || $_has_links || $_has_mini;
$_has_cols = $_has_brand || $_has_contact || $_has_links || $_has_mini || $hot_cat_count > 0;
?>
<?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 footer-logo" 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 footer-logo" 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 footer-contact">
<?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 fcode-links">
<?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 if ($_has_cols) : ?>
<ul class="list-inline footer-template-1">
<li class="footer-col footer-col--brand<?php echo esc_attr($_brand_vis_cls); ?>" style="max-width:300px;">
<?php if (!empty($footer_brand['img'])) : ?>
<p>
<a class="footer-logo" href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr($blog_name); ?>">
<img class="site-footer__logo site-footer__logo--day footer-logo-img" src="<?php echo esc_url($footer_brand['img']); ?>" alt="<?php echo esc_attr($blog_name); ?>" style="height:40px;width:auto;">
<?php if (!empty($footer_brand['img_dark'])) : ?>
<img class="site-footer__logo site-footer__logo--night footer-logo-img" src="<?php echo esc_url($footer_brand['img_dark']); ?>" alt="<?php echo esc_attr($blog_name); ?>" style="height:40px;width:auto;">
<?php endif; ?>
</a>
</p>
<?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 if (!empty($footer_brand['title'])) : ?>
<p class="title-h-left site-footer__title"><?php echo esc_html($footer_brand['title']); ?></p>
<?php endif; ?>
</div>
<?php if ($blog_description !== '') : ?>
<div class="footer-muted em09 site-footer__desc"><?php echo esc_html($blog_description); ?></div>
<?php endif; ?>
<?php if (!empty($footer_brand['custom_code'])) : ?>
<div class="footer-muted em09 site-footer__brand-code"><?php echo wp_kses_post($footer_brand['custom_code']); ?></div>
<?php endif; ?>
</li>
<li class="footer-col footer-col--links" style="max-width:550px;">
<?php
$link_bits = [];
foreach ((array) $quick_links as $ql) {
$label = $ql['name'] ?? $ql['label'] ?? '';
$url = $render_link_url($ql['url'] ?? '');
if ($label !== '') {
$link_bits[] = '<a href="' . esc_url($url) . '">' . esc_html($label) . '</a>';
}
}
foreach ((array) $more_links as $ml) {
$label = $ml['name'] ?? $ml['label'] ?? '';
$url = $render_link_url($ml['url'] ?? '');
if ($label !== '') {
$link_bits[] = '<a href="' . esc_url($url) . '">' . esc_html($label) . '</a>';
}
}
foreach ((array) $friend_links as $fl) {
$label = $fl['name'] ?? '';
$url = $fl['url'] ?? '#';
if ($label !== '') {
$link_bits[] = '<a href="' . esc_url($url) . '" target="_blank" rel="noopener noreferrer nofollow">' . esc_html($label) . '</a>';
}
}
if ($hot_cat_count > 0) {
$_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);
}
foreach ($_hot_cats as $hc) {
$link_bits[] = '<a href="' . esc_url(get_category_link($hc->term_id)) . '">' . esc_html($hc->name) . '</a>';
}
}
if (!empty($link_bits)) :
?>
<p class="fcode-links"><?php echo implode(' ', $link_bits); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['code_1'])) : ?>
<div class="footer-muted em09"><?php echo wp_kses_post($footer_contact_ext['code_1']); ?></div>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['code_2'])) : ?>
<div class="footer-muted em09"><?php echo wp_kses_post($footer_contact_ext['code_2']); ?></div>
<?php endif; ?>
<div class="footer-contact mt10<?php echo esc_attr($_contact_vis_cls); ?>">
<?php if (!empty($footer_contact_ext['wechat_img'])) : ?>
<a class="toggle-radius hover-show nowave footer-contact__item" href="javascript:;" title="<?php esc_attr_e('微信', 'aksrt'); ?>">
<i class="fab fa-weixin" aria-hidden="true"></i>
<span class="hover-show-con footer-wechat-img">
<img height="100" src="<?php echo esc_url($footer_contact_ext['wechat_img']); ?>" alt="<?php esc_attr_e('微信', 'aksrt'); ?>">
</span>
</a>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['qq'])) : ?>
<a class="toggle-radius footer-contact__item" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('QQ', 'aksrt'); ?>" href="<?php echo esc_url('https://wpa.qq.com/msgrd?v=3&uin=' . rawurlencode((string) $footer_contact_ext['qq']) . '&site=qq&menu=yes'); ?>">
<i class="fab fa-qq" aria-hidden="true"></i>
</a>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['weibo'])) : ?>
<a class="toggle-radius footer-contact__item" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('微博', 'aksrt'); ?>" href="<?php echo esc_url($footer_contact_ext['weibo']); ?>">
<i class="fab fa-weibo" aria-hidden="true"></i>
</a>
<?php endif; ?>
<?php if (!empty($footer_contact_ext['email'])) : ?>
<a class="toggle-radius footer-contact__item" title="<?php esc_attr_e('邮箱', 'aksrt'); ?>" href="<?php echo esc_url('mailto:' . $footer_contact_ext['email']); ?>">
<i class="fas fa-envelope" aria-hidden="true"></i>
</a>
<?php endif; ?>
<?php foreach ((array) $footer_contacts as $contact) :
$c_icon = $contact['icon'] ?? '';
$c_url = $contact['url'] ?? '#';
$c_label = $contact['title'] ?? ($contact['label'] ?? (function_exists('aksrt_icon_key_to_name') ? aksrt_icon_key_to_name($c_icon) : ''));
$c_svg = function_exists('aksrt_inline_svg') ? aksrt_inline_svg($c_icon) : '';
?>
<a class="toggle-radius footer-contact__item" href="<?php echo esc_url($c_url); ?>" target="_blank" rel="noopener noreferrer" title="<?php echo esc_attr($c_label); ?>" aria-label="<?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>
</li>
<?php if ($_has_mini) : ?>
<li class="footer-col footer-col--mini<?php echo esc_attr($_mini_vis_cls); ?>">
<?php foreach ($footer_mini['items'] as $mi) : ?>
<div class="footer-miniimg">
<?php if (!empty($mi['img'])) : ?>
<img src="<?php echo esc_url($mi['img']); ?>" alt="<?php echo esc_attr($mi['label'] ?? ''); ?>" width="90" height="90" loading="lazy">
<?php endif; ?>
<?php if (!empty($mi['label'])) : ?>
<div class="em09 footer-muted"><?php echo esc_html($mi['label']); ?></div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<p class="site-footer__copyright footer-conter">
&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; ?>
<?php
$footer_bits = [];
if (!empty($icp_number)) {
$footer_bits[] = '<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer nofollow">' . esc_html($icp_number) . '</a>';
}
if (!empty($police_number)) {
$footer_bits[] = '<a href="https://beian.mps.gov.cn/" target="_blank" rel="noopener noreferrer nofollow">' . esc_html($police_number) . '</a>';
}
$copy = '&copy; ' . esc_html(gmdate('Y')) . ' ' . esc_html($blog_name) . '.';
if (!empty($copyright_text)) {
$copy .= ' ' . wp_kses_post($copyright_text);
} else {
$copy .= ' ' . esc_html__('由 WordPress 强力驱动。', 'aksrt');
}
if ($footer_text !== '') {
$copy .= ' ' . esc_html($footer_text);
}
if (!empty($footer_bits)) {
$copy .= ' ' . implode(' · ', $footer_bits);
}
if (!empty($footer_customize_code)) {
$copy .= ' ' . wp_kses_post($footer_customize_code);
}
?>
<p class="footer-conter site-footer__copyright"><?php echo $copy; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
</div>
</footer>
<!-- 浮动右侧按钮组 -->
<?php
$floating_settings = $has_settings ? AKSRT_Settings::get_floating_buttons_settings() : [];