-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfunctions.php
executable file
·88 lines (67 loc) · 2.29 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
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
<?php
if (!defined('ABSPATH')) {
die();
}
define('DIVI_CHILD_VERSION', '2.3.0');
// INFO: Setup
/**
* STATIC: Load all scripts and styles
*/
function divi_child_enqueue_scripts() {
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('divi-fonts', get_stylesheet_directory_uri() . '/assets/css/fonts.css');
wp_enqueue_script('wp-i18n');
wp_enqueue_script('divi-scripts', get_stylesheet_directory_uri() . '/assets/js/main.js', ['jquery', 'wp-i18n'], null, true);
$options = get_option('divi_child_options');
wp_localize_script('divi-scripts', 'themeOptions', $options);
}
add_action('wp_enqueue_scripts', 'divi_child_enqueue_scripts');
/**
* STATIC: Register Script Translations
*
* @since 2.3.0
*/
function divi_child_set_script_translations() {
wp_set_script_translations('divi-scripts', 'divi-child', get_stylesheet_directory() . '/languages');
}
add_action('wp_enqueue_scripts', 'divi_child_set_script_translations', 100);
/**
* STATIC: Load all language files
*/
function divi_child_languages() {
load_child_theme_textdomain('divi-child', get_stylesheet_directory() . '/languages');
load_child_theme_textdomain('Divi', get_stylesheet_directory() . '/languages/theme'); //Divi Theme
load_child_theme_textdomain('et-core', get_stylesheet_directory() . '/languages/core'); //Divi Core
load_child_theme_textdomain('et_builder', get_stylesheet_directory() . '/languages/builder'); //Divi Builder
}
add_action('after_setup_theme', 'divi_child_languages');
/**
* STATIC: Custom Body Class for Child Theme
*/
function divi_child_body_class($classes) {
$classes[] = 'child';
return $classes;
}
add_action('body_class', 'divi_child_body_class');
// Migration
include_once 'includes/migration.php';
migrate(DIVI_CHILD_VERSION);
// Admin
include_once 'admin/admin.php';
// Helpers
include_once 'includes/helpers.php';
// Custom Fonts
include_once 'includes/class_custom_fonts.php';
Custom_Fonts::get_instance();
// GDPR
include_once 'includes/child_gdpr.php';
// Bugfixes
include_once 'includes/child_bugfixes.php';
// Pagespeed
include_once 'includes/child_pagespeed.php';
// Accessibility
include_once 'includes/child_a11y.php';
// Miscellaneous
include_once 'includes/child_misc.php';
/** -------- Add your own code after this! -------- **/
?>