-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
44 lines (34 loc) · 1.58 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
<?php
add_theme_support( 'title-tag' );
add_action('admin_bar_init', 'remove_admin_login_header');
function remove_admin_login_header() {
remove_action('wp_head', '_admin_bar_bump_cb');
}
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
require_once('includes/post_json.php');
require_once('includes/custom_post_types.php');
// Load scripts
function load_vue_scripts() {
vue_load_style('app.css', '/dist/css/app.css', false, null);
vue_load_script('manifest.js', '/dist/js/manifest.js', true);
vue_load_script('vendor.js', '/dist/js/vendor.js', true);
vue_load_script('app.js', '/dist/js/app.js', true);
}
function vue_load_style($name, $filepath) {
if(file_exists(get_template_directory() . $filepath))
wp_enqueue_style($name, get_theme_file_uri( $filepath ), array(), filemtime(get_template_directory() . $filepath), false );
}
function vue_load_script($name, $filepath, $footer) {
if(file_exists(get_template_directory() . $filepath))
wp_enqueue_script( $name, get_theme_file_uri( $filepath ), array(), filemtime(get_template_directory() . $filepath), $footer );
}
add_action('wp_enqueue_scripts', 'load_vue_scripts', 100);
// Update CSS within in Admin
function admin_style() {
wp_enqueue_style('admin-styles', get_template_directory_uri().'/admin.css');
}
add_action('admin_enqueue_scripts', 'admin_style');
?>