-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpage.php
More file actions
61 lines (53 loc) · 2.04 KB
/
page.php
File metadata and controls
61 lines (53 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* 默认页面模板(带侧边栏)
*
* @package Developer_Starter
*/
get_header();
// 检查侧边栏是否激活
$has_sidebar = is_active_sidebar( 'sidebar-page' );
?>
<div class="page-header" style="background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%); padding: 100px 0 60px;">
<div class="container">
<h1 class="page-title" style="color: #fff; text-align: center; font-size: 2.5rem; margin: 0;">
<?php the_title(); ?>
</h1>
</div>
</div>
<article class="page-content section-padding">
<div class="container">
<?php
// 检查是否有模块配置
$modules = get_post_meta( get_the_ID(), '_developer_starter_modules', true );
if ( ! empty( $modules ) && is_array( $modules ) ) :
// 模块页面始终全宽
developer_starter_render_page_modules();
else :
// 普通页面内容 - 根据侧边栏状态调整布局
?>
<div class="page-layout <?php echo $has_sidebar ? 'has-sidebar' : 'no-sidebar'; ?>">
<div class="page-main-content">
<div class="entry-content">
<?php
while ( have_posts() ) :
the_post();
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">',
'after' => '</div>',
) );
endwhile;
?>
</div>
</div>
<?php if ( $has_sidebar ) : ?>
<div class="page-sidebar">
<?php get_sidebar(); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</article>
<?php get_footer(); ?>