forked from Automattic/_s
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
50 lines (41 loc) · 1.38 KB
/
home.php
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
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package _mrw
*/
get_header();
$_mrw_posts_page = get_option( 'page_for_posts' );
?>
<main id="content" class="site-main">
<?php
if ( have_posts() ) :
$_mrw_page_for_posts = get_option( 'page_for_posts' );
$_mrw_blog_content = get_the_content( null, false, (int) $_mrw_page_for_posts );
?>
<header class="page-header is-layout-constrained">
<h1 class="page-title"><?php echo wp_kses_post( get_the_title( (int) $_mrw_page_for_posts ) ); ?></h1>
<?php
if ( $_mrw_blog_content ) {
echo '<div class="archive-description">' . wp_kses_post( apply_filters( 'the_content', $_mrw_blog_content ) ) . '</div>'; //phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
}
?>
</header>
<?php
/* Start the Loop */
get_template_part( 'template-parts/posts-loop' );
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</main><!-- #main -->
<?php
block_template_part( 'sidebar' );
get_footer();