-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
executable file
·99 lines (80 loc) · 2.77 KB
/
functions.php
File metadata and controls
executable file
·99 lines (80 loc) · 2.77 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
<?php
if ( !function_exists( 'prelude_features' ) ) {
// Register Theme Features
function prelude_features() {
// Add theme support for Automatic Feed Links
add_theme_support( 'automatic-feed-links' );
// Add theme support for Post Formats
add_theme_support('post-formats', array('status', 'quote', 'gallery', 'image', 'video', 'audio', 'link', 'aside') );
// Add theme support for Featured Images
add_theme_support( 'post-thumbnails' );
// Add theme support for HTML5 Semantic Markup
add_theme_support('html5', array('search-form', 'comment-form', 'comment-list', 'gallery', 'caption') );
// Add theme support for document Title tag
add_theme_support( 'title-tag' );
// Clean up the default WordPress head section
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'start_post_rel_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'adjacent_posts_rel_link' );
}
add_action( 'after_setup_theme', 'prelude_features' );
}
/**
* Load jQuery
*/
if ( !is_admin() ) {
add_action('wp_enqueue_scripts',function() {
wp_deregister_script('jquery');
wp_register_script('jquery', ('https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js'), false);
wp_enqueue_script('jquery');
});
}
/**
* Defer jQuery Parsing using the HTML5 defer property
*/
if (!(is_admin() )) {
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.min.js' ) ) return $url;
// return "$url' defer ";
return "$url' defer onload='";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
}
/**
* Link to all theme CSS files.
*/
function prelude_theme_scripts() {
// CSS
wp_enqueue_style('prelude-css', get_template_directory_uri() . '/assets/css/theme.min.css' );
// JS
wp_enqueue_script('prelude-js', get_template_directory_uri() . '/assets/js/theme.min.js', array(), '', true );
}
add_action( 'wp_enqueue_scripts', 'prelude_theme_scripts' );
/**
* Load menus
*/
require get_template_directory() . '/inc/menus.php';
/**
* Load custom post types
*/
require get_template_directory() . '/inc/custom-post-types.php';
/**
* Load widgets
*/
require get_template_directory() . '/inc/widgets.php';
/**
* Load tweaks
*/
require get_template_directory() . '/inc/tweaks.php';
/**
* Load thumbnail support and sizes
*/
require get_template_directory() . '/inc/thumbnails.php';
/**
* Load shortcodes
*/
require get_template_directory() . '/inc/shortcodes.php';