Files
wordpress-theme-aksrt/index.php
T

53 lines
1.4 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.
?>
<main id="main-content" class="site-main container" tabindex="-1">
<?php $has_sidebar = is_active_sidebar('sidebar-blog'); ?>
<div class="content-wrap">
<div class="content-layout<?php echo $has_sidebar ? '' : ' content-layout--no-sidebar'; ?>">
<div class="content-layout__primary">
<?php
$post_layout = class_exists('AKSRT_Settings')
? AKSRT_Settings::get_archive_layout()
: 'grid-cms';
$render_mode = in_array($post_layout, ['list', 'mini'], true) ? $post_layout : 'card';
?>
<?php if (have_posts()) : ?>
<?php aksrt_render_post_list(null, ['context' => 'archive', 'mode' => $render_mode, 'card_style' => 'standard']); ?>
<?php aksrt_render_pagination(); ?>
<?php else : ?>
<div class="no-results">
<p><?php esc_html_e('暂无文章。', 'aksrt'); ?></p>
</div>
<?php endif; ?>
</div>
<?php if ($has_sidebar) : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
</div>
</div>
</main>
<?php
get_footer();