You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
880 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
/**
* 首页入口文件
* 处理首页和分页显示
*/
?>
<?php get_header(); ?>
<?php
// 检查是否是分页请求
$paged = get_query_var('paged') ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1);
if ($paged > 1) {
// 如果是分页请求重定向到archive.php的逻辑
// 或者直接包含archive.php的内容
include(get_template_directory() . '/archive.php');
} else {
// 首页内容
?>
<div class="page-full-width">
<div class="row">
<div class="col-md-12">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
the_content();
}
}
?>
</div>
</div>
</div>
<?php
}
?>
<?php get_footer(); ?>