-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.php
More file actions
51 lines (43 loc) · 1.73 KB
/
index.php
File metadata and controls
51 lines (43 loc) · 1.73 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
<?php
/**
* The main template file
*
* @package Developer_Starter
* @since 1.0.0
*/
get_header();
?>
<div class="content-area">
<div class="container">
<div class="content-wrapper <?php echo is_active_sidebar( 'sidebar-main' ) ? 'has-sidebar' : ''; ?>">
<div class="main-content">
<?php if ( have_posts() ) : ?>
<?php if ( is_home() && ! is_front_page() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php single_post_title(); ?></h1>
</header>
<?php endif; ?>
<div class="posts-grid">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content/content', get_post_type() ); ?>
<?php endwhile; ?>
</div>
<?php the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( '← 上一页', 'developer-starter' ),
'next_text' => __( '下一页 →', 'developer-starter' ),
) ); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content/content', 'none' ); ?>
<?php endif; ?>
</div>
<?php if ( is_active_sidebar( 'sidebar-main' ) ) : ?>
<aside id="secondary" class="widget-area">
<?php dynamic_sidebar( 'sidebar-main' ); ?>
</aside>
<?php endif; ?>
</div>
</div>
</div>
<?php
get_footer();