-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
116 lines (96 loc) · 3.46 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
<?php
/**
* Theme Setup Functions and Definitions.
*
* @package Compass
* @subpackage HybridCore
* @copyright Copyright (c) 2015, Flagship Software, LLC
* @license GPL-2.0+
* @since 1.0.0
*/
// Include Hybrid Core.
require_once( trailingslashit( get_template_directory() ) . 'hybrid-core/hybrid.php' );
new Hybrid();
add_action( 'after_setup_theme', 'compass_setup', 10 );
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*
* @since 1.0.0
* @return void
*/
function compass_setup() {
// http://themehybrid.com/docs/theme-layouts
add_theme_support(
'theme-layouts',
array(
'1c' => __( '1 Column Wide', 'compass' ),
'1c-narrow' => __( '1 Column Narrow', 'compass' ),
'2c-l' => __( '2 Columns: Content / Sidebar', 'compass' ),
'2c-r' => __( '2 Columns: Sidebar / Content', 'compass' )
),
array( 'default' => is_rtl() ? '2c-r' :'2c-l' )
);
// http://themehybrid.com/docs/hybrid_set_content_width
hybrid_set_content_width( 1140 );
// http://codex.wordpress.org/Automatic_Feed_Links
add_theme_support( 'automatic-feed-links' );
// http://themehybrid.com/docs/hybrid-core-styles
add_theme_support( 'hybrid-core-styles', array( 'style', 'google-fonts', ) );
// https://github.com/FlagshipWP/flagship-library/wiki/Flagship-Site-Logo
add_theme_support( 'site-logo' );
// https://developer.wordpress.org/themes/functionality/navigation-menus/
register_nav_menus( array(
'primary' => _x( 'Primary Menu', 'nav menu location', 'compass' ),
'secondary' => _x( 'Secondary Menu', 'nav menu location', 'compass' ),
) );
// https://developer.wordpress.org/themes/functionality/post-formats/
add_theme_support( 'post-formats', array(
'aside',
'gallery',
'link',
'image',
'quote',
'status',
'video',
'audio',
'chat',
) );
// https://github.com/justintadlock/breadcrumb-trail
add_theme_support( 'breadcrumb-trail' );
// https://github.com/justintadlock/get-the-image
add_theme_support( 'get-the-image' );
// http://themehybrid.com/docs/template-hierarchy
add_theme_support( 'hybrid-core-template-hierarchy' );
// https://github.com/FlagshipWP/flagship-library/wiki/Flagship-Author-Box
add_theme_support( 'flagship-author-box' );
// https://github.com/FlagshipWP/flagship-library/wiki/Flagship-Footer-Widgets
add_theme_support( 'flagship-footer-widgets', 3 );
}
add_action( 'after_setup_theme', 'compass_includes', 10 );
/**
* Load all required theme files.
*
* @since 1.0.0
* @return void
*/
function compass_includes() {
// Set the includes directories.
$includes_dir = trailingslashit( get_template_directory() ) . 'includes/';
// Load the main file in the Flagship library directory.
require_once $includes_dir . 'vendor/flagship-library/flagship-library.php';
// Load all PHP files in the vendor directory.
require_once $includes_dir . 'vendor/tha-theme-hooks.php';
// Load all PHP files in the includes directory.
require_once $includes_dir . 'compatibility.php';
require_once $includes_dir . 'general.php';
require_once $includes_dir . 'scripts.php';
require_once $includes_dir . 'widgetize.php';
}
// Add a hook for child themes to execute code.
do_action( 'flagship_after_setup_parent' );
// delete this
define('SCRIPT_DEBUG', true);