-
Notifications
You must be signed in to change notification settings - Fork 23
/
home.php
44 lines (37 loc) · 802 Bytes
/
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
<?php
/**
* Home
*
* @package BEStarter
* @author Bill Erickson
* @since 1.0.0
* @license GPL-2.0+
**/
/**
* Home Content
*/
function be_home_content() {
if ( get_query_var( 'paged' ) ) {
return;
}
$page_id = get_option( 'page_for_posts' );
if ( empty( $page_id ) ) {
return;
}
$loop = new WP_Query( [ 'post_type' => 'page', 'p' => $page_id ] );
if ( $loop->have_posts() ) {
while( $loop->have_posts() ) {
$loop->the_post();
global $post;
if ( ! empty( $post->post_content ) ) {
echo '<div class="block-area block-area-home">';
the_content();
echo '</div>';
}
}
}
wp_reset_postdata();
}
add_action( 'tha_content_while_before', 'be_home_content', 20 );
// Build the page.
require get_template_directory() . '/archive.php';