首轮实机体验暴露的问题: - 投稿页仍在渲染主题头部的 all_top_fluid 挂件区、页脚与浮动入口, 与工作台顶栏重复。header.php / footer.php 新增 jio_render_header、 jio_render_footer、jio_render_fluid_widgets 过滤器,工作台模式下全部关闭 - 区块 Inspector 被写在 BlockList 之后,作为正文流的一部分渲染出 一个巨大的「未选择区块」白框;移除内联 Inspector(区块设置改由 行内工具栏的区块菜单提供) - 中文正文被 wordcount 的 'words' 口径算成「字数:1」;改用 characters_excluding_spaces,与前台 TinyMCE 字数一致 - 行宽 820px、标题 34px 偏松散;收窄到 720px / 27px,正文 16px/1.85, 段落间距与选区描边收敛,行内工具栏改为深色圆角悬浮条 新增本地视觉验收脚本(不参与运行时): - scripts/preview.cjs:用模拟 bootstrap 生成离线预览页 - scripts/shoot.cjs:桌面/移动端截图与控制台错误采集 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
72 lines
2.9 KiB
PHP
72 lines
2.9 KiB
PHP
<?php
|
|
/**
|
|
* Site header: document shell + legacy-contract top navigation.
|
|
*
|
|
* @package Jio
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$jio_header_settings = class_exists('\Jio\Settings\Settings')
|
|
? \Jio\Settings\Settings::read_domain('page_display', 'header-nav')
|
|
: [];
|
|
$jio_header_layout = sanitize_key((string) ($jio_header_settings['header_layout'] ?? '1'));
|
|
if (!in_array($jio_header_layout, ['1', '2', '3'], true)) {
|
|
$jio_header_layout = '1';
|
|
}
|
|
$jio_mobile_layout = sanitize_key((string) ($jio_header_settings['mobile_header_layout'] ?? 'center'));
|
|
if (!in_array($jio_mobile_layout, ['center', 'left'], true)) {
|
|
$jio_mobile_layout = 'center';
|
|
}
|
|
$jio_mobile_align = sanitize_key((string) ($jio_header_settings['mobile_navbar_align'] ?? 'left'));
|
|
if (!in_array($jio_mobile_align, ['top', 'left', 'right'], true)) {
|
|
$jio_mobile_align = 'left';
|
|
}
|
|
|
|
$jio_initial_theme_mode = '';
|
|
if (class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'initial_theme_mode')) {
|
|
$jio_initial_theme_mode = (string) apply_filters('jio_initial_theme_mode', \Jio\Settings\Settings::initial_theme_mode());
|
|
}
|
|
$jio_has_initial_theme = in_array($jio_initial_theme_mode, ['dark', 'light'], true);
|
|
|
|
$jio_body_classes = [];
|
|
// legacy: body.nav-fixed drives top padding + hero pull-under-nav. The sign
|
|
// page lays out its own shell, so it opts out of the fixed-nav offset.
|
|
$jio_is_sign_page = function_exists('jio_is_auth_page_request') && jio_is_auth_page_request();
|
|
if (!$jio_is_sign_page && (!isset($jio_header_settings['nav_fixed']) || !empty($jio_header_settings['nav_fixed']))) {
|
|
$jio_body_classes[] = 'nav-fixed';
|
|
} elseif (!$jio_is_sign_page) {
|
|
$jio_body_classes[] = 'has-static-nav';
|
|
}
|
|
|
|
if ($jio_initial_theme_mode === 'dark') {
|
|
$jio_body_classes[] = 'theme-dark';
|
|
$jio_body_classes[] = 'dark-theme';
|
|
} elseif ($jio_initial_theme_mode === 'light') {
|
|
$jio_body_classes[] = 'white-theme';
|
|
}
|
|
$jio_body_classes[] = 'header-layout-' . $jio_header_layout;
|
|
$jio_body_classes[] = 'mobile-header-' . $jio_mobile_layout;
|
|
$jio_body_classes[] = 'mobile-nav-' . $jio_mobile_align;
|
|
|
|
?><!DOCTYPE html>
|
|
<html lang="<?php echo esc_attr(str_replace('_', '-', get_bloginfo('language'))); ?>"<?php echo $jio_initial_theme_mode === 'dark' ? ' class="dark"' : ''; ?><?php echo $jio_has_initial_theme ? ' data-theme="' . esc_attr($jio_initial_theme_mode) . '"' : ''; ?>>
|
|
<head>
|
|
<meta charset="<?php bloginfo('charset'); ?>">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
|
|
<?php wp_head(); ?>
|
|
</head>
|
|
<body <?php body_class($jio_body_classes); ?><?php echo $jio_has_initial_theme ? ' data-theme="' . esc_attr($jio_initial_theme_mode) . '"' : ''; ?>>
|
|
<?php wp_body_open(); ?>
|
|
|
|
|
|
<?php
|
|
if (apply_filters('jio_render_header', true) && function_exists('jio_header')) {
|
|
jio_header();
|
|
}
|
|
|
|
if (apply_filters('jio_render_fluid_widgets', true)) {
|
|
\Jio\WidgetSystem\WidgetAreas::render('all_top_fluid', 'fluid-widget-wrap');
|
|
}
|
|
?>
|