-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
48 lines (37 loc) · 983 Bytes
/
front-page.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
<?php
/**
* Front page.
*
* @author Craig Simpson <[email protected]>
* @package Whitespace\Theme
* @since 1.0.0
*/
declare( strict_types=1 );
namespace Whitespace\Theme;
defined( 'ABSPATH' ) || exit;
add_action( 'genesis_meta', __NAMESPACE__ . '\\front_page_setup' );
/**
* Output the welcome banner.
*
* @return void
*/
function front_page_setup(): void {
// Add body class.
add_filter( 'body_class',function($classes) {
return array_merge( $classes, [ 'archive' ] );
} );
// Output welcome area.
add_action( 'genesis_after_header', __NAMESPACE__ . '\\welcome_widget_area' );
}
/**
* Hook welcome widget area after site header.
*
* @return void
*/
function welcome_widget_area(): void {
$post_id = get_the_ID();
$title = get_post_meta($post_id, 'cs_home_title', true);
$introduction = get_post_meta($post_id, 'cs_home_introduction', true);
include locate_template( 'views/home/welcome.php' );
}
genesis();