-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfunctions.php
143 lines (123 loc) · 3.93 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
<?php
/**
* ThemeCore setup and initialization.
*
* @package ThemeCore
* @author Brad Potter
* @link http://www.bradpotter.com/
* @copyright Copyright (c) 2015, Brad Potter
* @license GPL-2.0+
* @since 2.2.6
*/
defined( 'ABSPATH' ) || exit;
define( 'CHILD_THEME_NAME', 'ThemeCore' );
define( 'CHILD_THEME_URL', 'http://www.themecore.com' );
define( 'CHILD_THEME_VERSION', '2.2.6' );
add_action( 'after_setup_theme', 'themecore_load_textdomain' );
/**
* Load ThemeCore textdomain.
*/
function themecore_load_textdomain() {
load_child_theme_textdomain(
'themecore',
trailingslashit( get_stylesheet_directory() ) . 'languages'
);
}
add_action( 'init', 'themecore_register_image_sizes', 5 );
/**
* Register custom image sizes.
*/
function themecore_register_image_sizes() {
add_image_size( 'custom-full', 1140, 641, TRUE );
add_image_size( 'custom-large', 740, 416, TRUE );
add_image_size( 'custom-medium', 340, 191, TRUE );
}
add_filter('image_size_names_choose', 'themecore_merge_image_sizes');
/**
* Show custom image sizes in WordPress Uploader.
*/
function themecore_merge_image_sizes($sizes) {
$addsizes = array(
'custom-full' => __('Custom Full'),
'custom-large' => __('Custom Large'),
'custom-medium' => __('Custom Medium'),
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
add_action( 'genesis_setup', 'themecore_setup', 15 );
/**
* Setup ThemeCore.
*/
function themecore_setup() {
add_theme_support( 'genesis-responsive-viewport' );
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'search-form',
'gallery',
'caption',
) );
add_theme_support( 'custom-background' );
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'menu-footer',
'site-inner',
'footer-widgets',
'footer',
) );
add_theme_support( 'genesis-menus', array(
'primary' => __( 'Primary Navigation Menu', 'genesis' ),
'secondary' => __( 'Secondary Navigation Menu', 'genesis' ),
'footer' => __( 'Footer Navigation Menu', 'genesis' ),
) );
add_theme_support( 'genesis-accessibility', array(
'404-page',
'headings',
'rems',
'search-form',
'skip-links',
) );
add_theme_support( 'genesis-footer-widgets', 3 );
}
add_action( 'genesis_setup', 'themecore_includes', 15 );
/**
* Load functions and helpers.
*/
function themecore_includes() {
require_once( CHILD_DIR . '/includes/accessibility.php' );
require_once( CHILD_DIR . '/includes/footer-navigation-menu.php' );
}
add_action( 'wp_enqueue_scripts', 'themecore_enqueue_scripts' );
/**
* Enqueue scripts and styles.
*/
function themecore_enqueue_scripts() {
wp_enqueue_script( 'themecore-drop-down-menu', get_stylesheet_directory_uri() . '/assets/js/drop-down-menu.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'themecore-responsive-menu', get_stylesheet_directory_uri() . '/assets/js/responsive-menu.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_style( 'themecore-responsive-menu-css', get_stylesheet_directory_uri() . '/assets/css/responsive-menu.css', array(), '1.0.0' );
wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,400,700,900', array(), CHILD_THEME_VERSION );
wp_enqueue_style( 'dashicons' );
}
add_filter( 'genesis_post_info', 'themecore_post_info_filter' );
/**
* Customize entry meta in the entry header.
*/
function themecore_post_info_filter($post_info) {
$post_info = '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
add_filter('genesis_footer_creds_text', 'themecore_footer_creds_filter');
/**
* Customize footer credits.
*/
function themecore_footer_creds_filter( $creds ) {
$creds = 'Copyright [footer_copyright] · <a href="http://www.themecore.com">ThemeCore</a> on <a href="http://www.studiopress.com">Genesis Framework</a> · All Rights Reserved';
return $creds;
}
/**
* Load Genesis
*/
require_once get_template_directory() . '/lib/init.php';