-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
149 lines (121 loc) · 3.69 KB
/
functions.php
File metadata and controls
149 lines (121 loc) · 3.69 KB
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
144
145
146
147
148
149
<?php
$devMode = $_SERVER['SERVER_NAME'] === 'blog.thedevbuild.com';
if (!function_exists( 'thedevbuild_setup' )) {
function thedevbuild_setup() {
// Add default post and comments RSS feed links to head
add_theme_support( 'automatic-feed-links' );
// Add theme support for title tag <title>
add_theme_support( 'title-tag' );
// Add theme support for post-formats
add_theme_support(
'post-formats',
[
'link',
'aside',
'gallery',
'image',
'quote',
'status',
'video',
'audio',
'chat',
]
);
// Add theme support for post thumbnails
add_theme_support( 'post-thumbnails' );
// Add theme suport for core markup to output valid HTML5
add_theme_support(
'html5',
[
'comment-form',
'comment-list',
'gallery',
'caption',
'style',
'script',
'navigation-widgets',
]
);
// Add support for core custom logo
$logo_height = 40;
$logo_width = "auto";
add_theme_support(
'custom-logo',
[
'height' => $logo_height,
'width' => $logo_width,
'flex-width' => true,
'flex-height' => true,
'unlink-homepage-logo' => true,
]
);
// Add theme support for block styles
add_theme_support( 'wp-block-styles' );
// Add theme support for full and wide align images
add_theme_support( 'align-wide' );
// Add theme support for editor styles
add_theme_support( 'editor-styles' );
// Custom background color.
add_theme_support(
'custom-background',
[
'default-color' => 'd1e4dd',
]
);
// Add support for responsive embedded content.
add_theme_support( 'responsive-embeds' );
// Add support for custom line height controls.
add_theme_support( 'custom-line-height' );
// Add support for experimental link color control.
add_theme_support( 'experimental-link-color' );
// Add support for experimental cover block spacing.
add_theme_support( 'custom-spacing' );
// Add support for custom units.
// This was removed in WordPress 5.6 but is still required to properly support WP 5.5.
add_theme_support( 'custom-units' );
}
}
add_action( 'after_setup_theme', 'thedevbuild_setup' );
if ( ! function_exists( 'thedevbuild_scripts' ) ) {
function thedevbuild_scripts() {
// main style
wp_enqueue_style(
'thedevbuild-main-style',
get_template_directory_uri() . ($devMode === false ? '/assets/css/main.css' : '/assets/css/main.min.css'),
[],
wp_get_theme()->get( 'Version' )
);
// main script
wp_enqueue_script(
'thedevbuild-main-script',
get_template_directory_uri() . ($devMode === false ? '/assets/js/main.js' : '/assets/js/main.min.js'),
[],
wp_get_theme()->get( 'Version' ),
true
);
}
}
add_action( 'wp_enqueue_scripts', 'thedevbuild_scripts' );
// remove admin bar
add_filter('show_admin_bar', '__return_false');
if ( ! function_exists( 'thedevbuild_excerpt_limit' ) ) {
function thedevbuild_excerpt_limit() {
return 30;
}
}
if ( ! function_exists( 'thedevbuild_post_excerpt_limit' ) ) {
function thedevbuild_post_excerpt_limit($length) {
return thedevbuild_excerpt_limit();
}
}
add_filter( 'excerpt_length', 'thedevbuild_post_excerpt_limit', 999 );
if ( ! function_exists( 'thedevbuild' ) ) {
function thedevbuild_excerpt_more( $more ) {
return '...';
}
}
add_filter( 'excerpt_more', 'thedevbuild_excerpt_more' );
// Custom template tags for the theme.
require get_template_directory() . '/inc/template-tags.php';
// Custom template functions for the theme.
require get_template_directory() . '/inc/template-functions.php';