-
Notifications
You must be signed in to change notification settings - Fork 1
/
front-page.php
58 lines (48 loc) · 1.19 KB
/
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
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Digital Creative Genesis.
*
* This file adds the front page template to the Digital Creative Genesis Theme.
*
* @package Digital Creative Genesis
* @author Laverty Creative
* @license GPL-2.0+
* @link https://lavertycreative.com/
*/
add_action( 'genesis_meta', 'digital_creative_genesis_home_setup' );
/**
* Set up the homepage layout
*
* @since 1.0.0
*/
function digital_creative_genesis_home_setup() {
// Add front-page body class.
add_filter( 'body_class', 'digital_creative_genesis_add_body_class' );
// Force full width content layout.
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Remove Genesis loop.
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'digital_creative_genesis_loop' );
}
/**
* Add front-page body class.
*
* @param array $classes Main body tag classes.
*/
function digital_creative_genesis_add_body_class( $classes ) {
$classes[] = 'front-page';
return $classes;
}
/**
* Add standard loop
*/
function digital_creative_genesis_loop() {
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
the_content();
endwhile;
endif;
}
// Run the Genesis loop.
genesis();