forked from erikflowers/shoelace-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
140 lines (113 loc) · 4.18 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
<?php
/**
* The functions file is used to initialize everything in the theme. It controls how the theme is loaded and
* sets up the supported features, default actions, and default filters. If making customizations, users
* should create a child theme and make changes to its functions.php file (not this one). Friends don't let
* friends modify parent theme files. ;)
*
* Child themes should do their setup on the 'after_setup_theme' hook with a priority of 11 if they want to
* override parent theme features. Use a priority of 9 if wanting to run before the parent theme.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the License,
* or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write
* to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package HybridBase
* @subpackage Functions
* @version 0.2.0
* @since 0.1.0
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2013, Justin Tadlock
* @link http://themehybrid.com/themes/hybrid-base
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
/* Load the core theme framework. */
require_once( trailingslashit( get_template_directory() ) . 'library/hybrid.php' );
new Hybrid();
/* Do theme setup on the 'after_setup_theme' hook. */
add_action( 'after_setup_theme', 'hybrid_base_theme_setup' );
/**
* Theme setup function. This function adds support for theme features and defines the default theme
* actions and filters.
*
* @since 0.1.0
* @access public
* @return void
*/
function hybrid_base_theme_setup() {
/* Get action/filter hook prefix. */
$prefix = hybrid_get_prefix();
/* Register menus. */
add_theme_support(
'hybrid-core-menus',
array( 'primary', 'secondary', 'subsidiary' )
);
/* Register sidebars. */
add_theme_support(
'hybrid-core-sidebars',
array( 'primary', 'secondary', 'subsidiary' )
);
/* Load scripts. */
add_theme_support(
'hybrid-core-scripts',
array( 'comment-reply' )
);
/* Load styles. */
add_theme_support(
'hybrid-core-styles',
array( '25px', 'gallery', 'parent', 'style' )
);
/* Load widgets. */
add_theme_support( 'hybrid-core-widgets' );
/* Load shortcodes. */
add_theme_support( 'hybrid-core-shortcodes' );
/* Enable custom template hierarchy. */
add_theme_support( 'hybrid-core-template-hierarchy' );
/* Load the media grabber. */
add_theme_support( 'hybrid-core-media-grabber' );
/* Enable theme layouts (need to add stylesheet support). */
add_theme_support(
'theme-layouts',
array( '1c', '2c-l', '2c-r' ),
array( 'default' => '1c', 'customizer' => true )
);
/* Allow per-post stylesheets. */
add_theme_support( 'post-stylesheets' );
/* Support pagination instead of prev/next links. */
add_theme_support( 'loop-pagination' );
/* The best thumbnail/image script ever. */
add_theme_support( 'get-the-image' );
/* Use breadcrumbs. */
add_theme_support( 'breadcrumb-trail' );
/* Nicer [gallery] shortcode implementation. */
add_theme_support( 'cleaner-gallery' );
/* Better captions for themes to style. */
add_theme_support( 'cleaner-caption' );
/* Automatically add feed links to <head>. */
add_theme_support( 'automatic-feed-links' );
/* Post formats. */
add_theme_support(
'post-formats',
array( 'aside', 'audio', 'chat', 'image', 'gallery', 'link', 'quote', 'status', 'video' )
);
/* Add support for a custom header image. */
add_theme_support(
'custom-header',
array( 'header-text' => false ) );
/* Custom background. */
add_theme_support(
'custom-background',
array( 'default-color' => 'ffffff' )
);
/* Handle content width for embeds and images. */
hybrid_set_content_width( 1280 );
}
// Register Custom Navigation Walker
require_once('wp_bootstrap_navwalker.php');
?>