-
Notifications
You must be signed in to change notification settings - Fork 0
/
front-page.php
47 lines (34 loc) · 1.31 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
<?php
add_action( 'genesis_meta', 'parallax_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function parallax_home_genesis_meta() {
if ( is_active_sidebar( 'home-section-1' ) || is_active_sidebar( 'home-section-2' ) || is_active_sidebar( 'home-section-3' ) || is_active_sidebar( 'home-section-4' ) || is_active_sidebar( 'home-section-5' ) ) {
//* Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs');
//* Remove the default Genesis loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
//* Add homepage widgets
add_action( 'genesis_after_header', 'parallax_homepage_widgets' );
}
}
//* Add markup for homepage widgets
function parallax_homepage_widgets() {
echo '<div class="home-odd home-section-1"><div class="wrap">';
genesis_widget_area( 'home-section-1-left', array(
'before' => '<div class="one-third first widget-area">',
'after' => '</div>',
) );
genesis_widget_area( 'home-section-1-right', array(
'before' => '<div class="two-thirds widget-area">',
'after' => '</div>',
) );
echo '</div></div>';
genesis_widget_area( 'home-section-2', array(
'before' => '<div class="home-even home-section-2 widget-area"><div class="wrap">',
'after' => '</div></div>',
) );
}
genesis();