-
Notifications
You must be signed in to change notification settings - Fork 15
/
functions.php
179 lines (151 loc) · 4.89 KB
/
functions.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/**
* Custom amendments for the theme.
*
* @category Genesis_Sandbox
* @package Functions
* @subpackage Functions
* @author Travis Smith and Jonathan Perez
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://surefirewebservices.com/
* @since 1.1.0
*/
// Initialize Sandbox ** DON'T REMOVE **
require_once( get_stylesheet_directory() . '/lib/init.php');
add_action( 'genesis_setup', 'gs_theme_setup', 15 );
//Theme Set Up Function
function gs_theme_setup() {
//Enable HTML5 Support
add_theme_support( 'html5' );
//Enable Post Navigation
add_action( 'genesis_after_entry_content', 'genesis_prev_next_post_nav', 5 );
/**
* 01 Set width of oEmbed
* genesis_content_width() will be applied; Filters the content width based on the user selected layout.
*
* @see genesis_content_width()
* @param integer $default Default width
* @param integer $small Small width
* @param integer $large Large width
*/
$content_width = apply_filters( 'content_width', 600, 430, 920 );
//Custom Image Sizes
add_image_size( 'featured-image', 225, 160, TRUE );
// Enable Custom Background
//add_theme_support( 'custom-background' );
// Enable Custom Header
//add_theme_support('genesis-custom-header');
// Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );
/**
* 07 Footer Widgets
* Add support for 3-column footer widgets
* Change 3 for support of up to 6 footer widgets (automatically styled for layout)
*/
add_theme_support( 'genesis-footer-widgets', 3 );
/**
* 08 Genesis Menus
* Genesis Sandbox comes with 4 navigation systems built-in ready.
* Delete any menu systems that you do not wish to use.
*/
add_theme_support(
'genesis-menus',
array(
'primary' => __( 'Primary Navigation Menu', CHILD_DOMAIN ),
'secondary' => __( 'Secondary Navigation Menu', CHILD_DOMAIN ),
'footer' => __( 'Footer Navigation Menu', CHILD_DOMAIN ),
'mobile' => __( 'Mobile Navigation Menu', CHILD_DOMAIN ),
)
);
// Add Mobile Navigation
add_action( 'genesis_before', 'gs_mobile_navigation', 5 );
//Enqueue Sandbox Scripts
add_action( 'wp_enqueue_scripts', 'gs_enqueue_scripts' );
/**
* 13 Editor Styles
* Takes a stylesheet string or an array of stylesheets.
* Default: editor-style.css
*/
//add_editor_style();
// Register Sidebars
gs_register_sidebars();
} // End of Set Up Function
// Register Sidebars
function gs_register_sidebars() {
$sidebars = array(
array(
'id' => 'home-top',
'name' => __( 'Home Top', CHILD_DOMAIN ),
'description' => __( 'This is the top homepage section.', CHILD_DOMAIN ),
),
array(
'id' => 'home-middle-01',
'name' => __( 'Home Left Middle', CHILD_DOMAIN ),
'description' => __( 'This is the homepage left section.', CHILD_DOMAIN ),
),
array(
'id' => 'home-middle-02',
'name' => __( 'Home Middle Middle', CHILD_DOMAIN ),
'description' => __( 'This is the homepage middle section.', CHILD_DOMAIN ),
),
array(
'id' => 'home-middle-03',
'name' => __( 'Home Right Middle', CHILD_DOMAIN ),
'description' => __( 'This is the homepage right section.', CHILD_DOMAIN ),
),
array(
'id' => 'home-bottom',
'name' => __( 'Home Bottom', CHILD_DOMAIN ),
'description' => __( 'This is the homepage right section.', CHILD_DOMAIN ),
),
array(
'id' => 'portfolio',
'name' => __( 'Portfolio', CHILD_DOMAIN ),
'description' => __( 'Use featured posts to showcase your portfolio.', CHILD_DOMAIN ),
),
array(
'id' => 'after-post',
'name' => __( 'After Post', CHILD_DOMAIN ),
'description' => __( 'This will show up after every post.', CHILD_DOMAIN ),
),
);
foreach ( $sidebars as $sidebar )
genesis_register_sidebar( $sidebar );
}
/**
* Enqueue and Register Scripts - Twitter Bootstrap, Font-Awesome, and Common.
*/
require_once('lib/scripts.php');
/**
* Add navigation menu
* Required for each registered menu.
*
* @uses gs_navigation() Sandbox Navigation Helper Function in gs-functions.php.
*/
//Add Mobile Menu
function gs_mobile_navigation() {
$mobile_menu_args = array(
'echo' => true,
);
gs_navigation( 'mobile', $mobile_menu_args );
}
// Add Widget Area After Post
add_action('genesis_after_entry', 'gs_do_after_entry');
function gs_do_after_entry() {
if ( is_single() ) {
genesis_widget_area(
'after-post',
array(
'before' => '<aside id="after-post" class="after-post"><div class="home-widget widget-area">',
'after' => '</div></aside><!-- end #home-left -->',
)
);
}
}