-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
91 lines (77 loc) · 2.87 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
<?php
function redrock_setup() {
add_theme_support('automatic-feed-links');
add_theme_support('title-tag');
add_theme_support('custom-logo', array(
'height' => 150,
'width' => 1500,
'flex-width' => true,
'header-text' => array(
'site-title'
),
));
add_theme_support('post-thumbnails');
set_post_thumbnail_size(720, 1200);
add_image_size('redrock-archive', 560, 9999);
register_nav_menus(array(
'header' => "Header Menu",
'social' => "Social Menu",
'colophon' => "Colophon Menu"
));
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
add_theme_support('post-formats', array(
'image',
'video',
'audio'
));
}
add_action('after_setup_theme', 'redrock_setup');
function redrock_content_width() {
$GLOBALS['content_width'] = apply_filters('redrock_content_width', 1140);
}
add_action('after_setup_theme', 'redrock_content_width', 0);
function redrock_fonts_url() {
return "https://use.typekit.net/fdd8eid.css";
}
function redrock_styles() {
wp_enqueue_style('redrock-fonts', redrock_fonts_url(), array(), null);
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/font-awesome/font-awesome.css', array(), '20151022');
if (defined('WP_DEBUG') && true === WP_DEBUG) {
wp_enqueue_style('redrock-style', get_stylesheet_uri(), array(), time());
}
else {
wp_enqueue_style('redrock-style', get_stylesheet_uri());
}
}
function redrock_scripts() {
wp_enqueue_script('redrock-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151112', true);
wp_enqueue_script('redrock-theme-scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery', 'masonry'), '20151130', true);
wp_enqueue_script('redrock-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151112', true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
function redrock_styles_and_scripts() {
redrock_styles();
redrock_scripts();
}
add_action('wp_enqueue_scripts', 'redrock_styles_and_scripts');
function redrock_html_js_class () {
echo "<script>document.documentElement.className = document.documentElement.className.replace('no-js','js');</script>" . "\n";
}
add_action('wp_head', 'redrock_html_js_class', 1);
require get_template_directory() . '/inc/template-tags.php';
require get_template_directory() . '/inc/extras.php';
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/jetpack.php';
require get_template_directory() . '/inc/plugin-enhancements.php';
require get_template_directory() . '/inc/single-post-filters.php';
require get_template_directory() . '/inc/meta-defaults.php';
require get_template_directory() . '/inc/open-graph.php';
require get_template_directory() . "/inc/share-image-default.php";