-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage_custom.php
More file actions
61 lines (49 loc) · 1.51 KB
/
page_custom.php
File metadata and controls
61 lines (49 loc) · 1.51 KB
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
59
60
61
<?php
/*
Template Name: Home Page - Widgets
*/
/** Exit if accessed directly */
if ( ! defined( 'ABSPATH' ) ) exit( 'Cheatin’ uh?' );
add_filter( 'body_class', 'torlesse_add_page_body_class' );
/**
* Add page specific body class
*
* @param $classes array Body Classes
* @return $classes array Modified Body Classes
*/
function torlesse_add_page_body_class( $classes ) {
$classes[] = 'homepage-widgets';
return $classes;
}
/**
* Test if the homepage widget area has widgets.
* If yes then remove post loop and display widgets instead
*
* @since 2.0.1
*/
if ( is_active_sidebar( 'homepage-widgets' )) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'torlesse_home_loop_helper' );
}
/**
* Display widget content for "Homepage Widgets".
*
* @since 2.0.1
*/
function torlesse_home_loop_helper() {
genesis_widget_area( 'homepage-widgets', array(
'before' => '<div class="slider-wide"><div class="wrap">',
'after' => '</div></div>',
) );
}
/**
* Force a layout setting for the page
*
* See: http://www.briangardner.com/code/force-layout-setting/
*
* @since 2.0.0
*/
//add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//Other possible layouts: __genesis_return_content_sidebar, __genesis_return_sidebar_content, __genesis_return_content_sidebar_sidebar, __genesis_return_sidebar_sidebar_content, __genesis_return_sidebar_content_sidebar, __genesis_return_full_width_content
// All Customisations above this comment
genesis();