-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
62 lines (46 loc) · 1.57 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
<?php
// Setup
function quad_setup() {
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
// Let WordPress manage the document title.
add_theme_support('title-tag' );
// Enable support for Post Thumbnails on posts and pages.
add_theme_support('post-thumbnails');
// Menu Registrations
register_nav_menus(array(
'primary' => 'Primary'
));
// Switch default core markup for search form, comment form, and comments to output valid HTML5.
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
}
// Scripts and Styles
function quad_scripts() {
// Versioning
$theme = wp_get_theme();
$version = $theme->get('Version');
// Remove jQuery
wp_deregister_script('jquery');
// Styles
wp_enqueue_style('css/app', get_stylesheet_directory_uri().'/dist/css/app.css', [], $version);
// Main JavaScript
wp_enqueue_script('js/app', get_stylesheet_directory_uri().'/dist/app.js', ['jquery'], $version, true);
}
// Implement Setup + Scripts
add_action('after_setup_theme', 'quad_setup');
add_action('wp_enqueue_scripts', 'quad_scripts');
// Function Extras
require get_template_directory().'/inc/acf.php';
require get_template_directory().'/inc/assets.php';
require get_template_directory().'/inc/customizer.php';
require get_template_directory().'/inc/gutenberg.php';
// Disable redirection if site in development mode
if(isset($_ENV['WP_ENV']) && $_ENV['WP_ENV'] == 'development') {
remove_action('template_redirect', 'redirect_canonical');
}