-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
110 lines (89 loc) · 2.28 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
<?php
/**
* Bucket Lite functions and definitions
*
* @package Bucket Lite
* @since Bucket Lite 1.0.0
*/
// ensure EXT is defined
if ( ! defined('EXT')) {
define('EXT', '.php');
}
#
# See: wpgrade-config.php -> include-paths for additional theme specific
# function and class includes
#
// Loads the theme's translated strings
load_theme_textdomain( 'bucket-lite', get_stylesheet_directory() . '/languages' );
// Theme specific settings
// -----------------------
// add theme support for post formats
// child themes note: use the after_setup_theme hook with a callback
$formats = array( 'video', 'audio', 'gallery', 'image', 'link' );
add_theme_support('post-formats', $formats);
add_theme_support( 'title-tag' );
// Initialize system core
// ----------------------
do_action('wpgrade_before_core');
require_once 'wpgrade-core/bootstrap'.EXT;
do_action('wpgrade_after_core');
#
# Please perform any initialization via options in wpgrade-config and
# calls in wpgrade-core/bootstrap. Required for testing.
#
/**
* http://codex.wordpress.org/Content_Width
*/
if ( ! isset($content_width)) {
$content_width = 960;
}
function post_format_icon($class_name = '') {
$post_format = get_post_format();
if ( $post_format ){
$icon_class = '';
switch ( $post_format ) {
case 'video':
$icon_class = 'icon-play';
break;
case 'audio':
$icon_class = 'icon-music';
break;
case 'image':
case 'gallery':
$icon_class = 'icon-camera';
break;
case 'quote':
$icon_class = 'icon-quotes';
break;
case 'link':
$icon_class = 'icon-link';
break;
default:
break;
} ?>
<div class="post-format-icon <?php echo $class_name; ?> post-format-icon__icon">
<i class="<?php echo $icon_class; ?>"></i>
</div>
<?php
}
}
/**
* Invoked in wpgrade-config.php
*/
function wpgrade_callback_thread_comments_scripts() {
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script('comment-reply');
}
}
/**
* Enqueue rtl style, if it's the case.
*/
function wpgrade_callback_enqueue_rtl_support(){
if ( is_rtl() ) {
wp_enqueue_style('rtl-support', wpgrade::resourceuri('css/localization/rtl.css') );
}
}
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';