-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
55 lines (46 loc) · 1.55 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
<?php
require __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-themerbasic.php';
require __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-themerbasic-customizer.php';
require __DIR__ . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-themerbasic-fontlist.php';
require __DIR__ . DIRECTORY_SEPARATOR . 'bb-modules' . DIRECTORY_SEPARATOR . 'bb-modules.php';
$themerbasic = new ThemerBasic();
add_action( 'wp_enqueue_scripts', 'themerbasic_styles' );
/**
* Add theme stylesheet
*/
function themerbasic_styles() {
wp_enqueue_style( 'themerbasic', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'themerbasic_scripts' );
function themerbasic_scripts() {
// Replace jquery with newer version
wp_deregister_script( 'jquery' );
wp_register_script(
'jquery',
get_template_directory_uri() . '/assets/jquery.min.js',
array(),
'2.2.4',
true
);
// Remove the jquery loader fallback as this can cause issues with autoptimize or other js combiners
remove_action( 'wp_footer', 'FLBuilder::include_jquery' );
wp_deregister_style( 'font-awesome' );
wp_register_style(
'font-awesome',
get_template_directory_uri() . '/assets/font-awesome/css/font-awesome.min.css',
array(),
'4.7.0'
);
}
add_filter( 'autoptimize_filter_noptimize', 'pagebuilder_noptimize', 10, 0 );
/**
* Only use combined and minified css/js for non-logged in users
* @return bool
*/
function pagebuilder_noptimize() {
if ( is_user_logged_in() ) {
return true;
} else {
return false;
}
}