58 lines
1.7 KiB
PHP
58 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* Homepage / posts index template.
|
|
*
|
|
* The homepage shell is handled by the fixed homepage helper so the blog entry
|
|
* behaves like a primary product surface instead of a generic archive loop.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (function_exists('aksrt_render_fixed_homepage') && aksrt_render_fixed_homepage()) {
|
|
return;
|
|
}
|
|
|
|
get_header();
|
|
|
|
// Fallback: when homepage shell is unavailable, keep a standard archive loop.
|
|
?>
|
|
|
|
<?php
|
|
// Zibll dual-column: sidebar is a sibling of .content-wrap under main.container.
|
|
// A sidebar column is useful only when visibility is enabled and at least one
|
|
// of its global/page-specific widget zones has content.
|
|
$has_sidebar_widgets = function_exists('aksrt_has_current_sidebar_widgets')
|
|
? aksrt_has_current_sidebar_widgets()
|
|
: (is_active_sidebar('all_sidebar_top') || is_active_sidebar('home_sidebar') || is_active_sidebar('all_sidebar_bottom'));
|
|
$has_sidebar = (function_exists('aksrt_is_show_sidebar') ? aksrt_is_show_sidebar() : true)
|
|
&& $has_sidebar_widgets;
|
|
?>
|
|
<main id="main-content" class="site-main container" tabindex="-1">
|
|
<div class="content-wrap">
|
|
<div class="content-layout">
|
|
<?php
|
|
$render_config = function_exists('aksrt_resolve_post_list_render_config')
|
|
? aksrt_resolve_post_list_render_config(['context' => 'archive'])
|
|
: ['context' => 'archive', 'mode' => 'list'];
|
|
?>
|
|
|
|
<?php if (have_posts()) : ?>
|
|
<?php aksrt_render_post_list(null, $render_config); ?>
|
|
<?php aksrt_render_pagination(); ?>
|
|
<?php else : ?>
|
|
<div class="no-results">
|
|
<p><?php esc_html_e('暂无文章。', 'aksrt'); ?></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
<?php if ($has_sidebar) : ?>
|
|
<?php get_sidebar(); ?>
|
|
<?php endif; ?>
|
|
</main>
|
|
|
|
<?php
|
|
get_footer();
|