fix(layout): restore Zibll float dual-column so content no longer overlaps sidebar
Align main shells to main.container > .content-wrap + .sidebar siblings, drop content-shell padding on dual-column hosts, and remove route flex overrides that disabled the negative-margin sidebar math.
This commit is contained in:
@@ -22,89 +22,89 @@ $show_sidebar = function_exists('aksrt_is_show_sidebar') ? aksrt_is_show_sidebar
|
||||
<div id="reading-progress-global" class="reading-progress-bar" role="progressbar" aria-label="<?php esc_attr_e('阅读进度', 'aksrt'); ?>" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<main id="main-content" class="site-main container content-shell content-shell--page page-content-<?php echo esc_attr($page_content_style); ?> page-id-<?php echo esc_attr((string) $page_id); ?>" tabindex="-1">
|
||||
|
||||
<?php if (is_active_sidebar('page_top_fluid_' . $page_id)) : ?>
|
||||
<div class="fluid-widget-wrap">
|
||||
<?php dynamic_sidebar('page_top_fluid_' . $page_id); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
// Zibll page.php: fluid top OUTSIDE main; main.container + content-wrap/layout + sidebar sibling.
|
||||
// Do not put content-shell padding/max-width on the dual-column host (breaks float math).
|
||||
?>
|
||||
<?php if (is_active_sidebar('page_top_fluid_' . $page_id)) : ?>
|
||||
<div class="fluid-widget-wrap">
|
||||
<?php dynamic_sidebar('page_top_fluid_' . $page_id); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<main id="main-content" class="site-main container page-content-<?php echo esc_attr($page_content_style); ?> page-id-<?php echo esc_attr((string) $page_id); ?>" tabindex="-1">
|
||||
<div class="content-wrap">
|
||||
<div class="content-layout<?php echo $show_sidebar ? '' : ' content-layout--no-sidebar'; ?>">
|
||||
<div class="content-layout__primary">
|
||||
<?php if (is_active_sidebar('page_top_content_' . $page_id)) : ?>
|
||||
<?php dynamic_sidebar('page_top_content_' . $page_id); ?>
|
||||
<?php endif; ?>
|
||||
<div class="content-layout">
|
||||
<?php if (is_active_sidebar('page_top_content_' . $page_id)) : ?>
|
||||
<?php dynamic_sidebar('page_top_content_' . $page_id); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
|
||||
$page_meta_header_style = get_post_meta(get_the_ID(), 'page_header_style', true);
|
||||
$ph_style_override = null;
|
||||
if ($page_meta_header_style !== '' && in_array($page_meta_header_style, ['', '1', '2', '3', 'not'], true)) {
|
||||
$ph_style_override = ($page_meta_header_style === 'not') ? '' : $page_meta_header_style;
|
||||
}
|
||||
$page_cover = (string) get_post_meta(get_the_ID(), 'page_header_cover_img', true);
|
||||
$header_args = [
|
||||
'title' => get_the_title(),
|
||||
];
|
||||
if ($ph_style_override !== null) {
|
||||
$header_args['style'] = $ph_style_override;
|
||||
}
|
||||
if ($page_cover !== '') {
|
||||
$header_args['cover'] = esc_url($page_cover);
|
||||
}
|
||||
?>
|
||||
<article <?php post_class('entry-page'); ?>>
|
||||
<?php get_template_part('templates/parts/page-header', null, $header_args); ?>
|
||||
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<figure class="entry-thumb">
|
||||
<?php the_post_thumbnail('large'); ?>
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="entry-content" data-aksrt-lightbox="<?php echo !empty($page_settings['lightbox']) ? '1' : '0'; ?>">
|
||||
<?php the_content(); ?>
|
||||
<?php
|
||||
wp_link_pages([
|
||||
'before' => '<nav class="page-links"><span class="page-links-title">' . esc_html__('分页:', 'aksrt') . '</span>',
|
||||
'after' => '</nav>',
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
if (comments_open() || get_comments_number()) {
|
||||
echo '<div class="theme-box box-body radius8 main-shadow comments-card">';
|
||||
comments_template();
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
$page_meta_header_style = get_post_meta(get_the_ID(), 'page_header_style', true);
|
||||
$ph_style_override = null;
|
||||
if ($page_meta_header_style !== '' && in_array($page_meta_header_style, ['', '1', '2', '3', 'not'], true)) {
|
||||
$ph_style_override = ($page_meta_header_style === 'not') ? '' : $page_meta_header_style;
|
||||
}
|
||||
$page_cover = (string) get_post_meta(get_the_ID(), 'page_header_cover_img', true);
|
||||
$header_args = [
|
||||
'title' => get_the_title(),
|
||||
];
|
||||
if ($ph_style_override !== null) {
|
||||
$header_args['style'] = $ph_style_override;
|
||||
}
|
||||
if ($page_cover !== '') {
|
||||
$header_args['cover'] = esc_url($page_cover);
|
||||
}
|
||||
?>
|
||||
<article <?php post_class('entry-page'); ?>>
|
||||
<?php get_template_part('templates/parts/page-header', null, $header_args); ?>
|
||||
endwhile;
|
||||
?>
|
||||
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<figure class="entry-thumb">
|
||||
<?php the_post_thumbnail('large'); ?>
|
||||
</figure>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="entry-content" data-aksrt-lightbox="<?php echo !empty($page_settings['lightbox']) ? '1' : '0'; ?>">
|
||||
<?php the_content(); ?>
|
||||
<?php
|
||||
wp_link_pages([
|
||||
'before' => '<nav class="page-links"><span class="page-links-title">' . esc_html__('分页:', 'aksrt') . '</span>',
|
||||
'after' => '</nav>',
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<?php
|
||||
if (comments_open() || get_comments_number()) {
|
||||
echo '<div class="theme-box box-body radius8 main-shadow comments-card">';
|
||||
comments_template();
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
endwhile;
|
||||
?>
|
||||
|
||||
<?php if (is_active_sidebar('page_bottom_content_' . $page_id)) : ?>
|
||||
<?php dynamic_sidebar('page_bottom_content_' . $page_id); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if (is_active_sidebar('page_bottom_content_' . $page_id)) : ?>
|
||||
<?php dynamic_sidebar('page_bottom_content_' . $page_id); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($show_sidebar) : ?>
|
||||
<?php get_sidebar(); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (is_active_sidebar('page_bottom_fluid_' . $page_id)) : ?>
|
||||
<div class="fluid-widget-wrap">
|
||||
<?php dynamic_sidebar('page_bottom_fluid_' . $page_id); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
|
||||
<?php if (is_active_sidebar('page_bottom_fluid_' . $page_id)) : ?>
|
||||
<div class="fluid-widget-wrap">
|
||||
<?php dynamic_sidebar('page_bottom_fluid_' . $page_id); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($page_settings['lightbox'])) : ?>
|
||||
<div class="lightbox-overlay" id="lightbox-overlay" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('图片预览', 'aksrt'); ?>">
|
||||
<button type="button" class="lightbox-close" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fas fa-times"></i></button>
|
||||
|
||||
Reference in New Issue
Block a user