-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
114 lines (89 loc) · 3.5 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
* Course Maker Pro
*
* This file adds functions to the Course Maker Pro theme.
*
* @package Course Maker Pro
* @author thebrandiD
* @license GPL-2.0+
* @link https://thebrandidthemes.com/
*/
// Start the engine.
require_once get_template_directory() . '/lib/init.php';
// Include functions file which checks for plugins.
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Load constants - use constants in code instead of functions to improve performance. Hat Tip to Tonya at Knowthecode.io.
$child_theme = wp_get_theme();
define( 'CHILD_THEME_DIR', get_stylesheet_directory() );
define( 'CHILD_THEME_URI', get_stylesheet_directory_uri() );
define( 'ROOT_DOMAIN_URL', home_url() );
define( 'CHILD_SITE_NAME', get_bloginfo( 'name' ) );
// Set Localization - do not remove!
add_action( 'after_setup_theme', 'course_maker_localization_setup' );
/**
* Loads text Domain
*
* @since 1.0.0
*/
function course_maker_localization_setup() {
load_child_theme_textdomain( genesis_get_theme_handle(), apply_filters( 'child_theme_textdomain', CHILD_THEME_DIR . '/languages', 'coursemaker' ) );
}
// Load Theme Setup and Configuration.
require_once CHILD_THEME_DIR . '/lib/theme-setup.php';
// Load custom Onboarding functions.
require_once CHILD_THEME_DIR . '/lib/onboarding-functions.php';
// Add the social icons functions.
require_once CHILD_THEME_DIR . '/lib/icon-functions.php';
// Add the custom meta boxes.
require_once CHILD_THEME_DIR . '/lib/metaboxes.php';
// Add custom sidebars.
require_once CHILD_THEME_DIR . '/lib/sidebars.php';
// Add the the attachment meta box class.
require_once CHILD_THEME_DIR . '/lib/meta-attachments.php';
require_once CHILD_THEME_DIR . '/lib/meta-attachments-init.php';
// Import Customizer custom toggle control.
require_once CHILD_THEME_DIR . '/lib/class-course-maker-toggle-control.php';
// Add Course Maker Pro Settings to the WordPress Customizer.
require_once CHILD_THEME_DIR . '/lib/customize.php';
// Add Color Scheme settings to WordPress Theme Customizer.
require_once CHILD_THEME_DIR . '/lib/customize-colors.php';
// Add the helper functions.
require_once CHILD_THEME_DIR . '/lib/helper-functions.php';
// Add the blog functions.
require_once CHILD_THEME_DIR . '/lib/blog-functions.php';
// Add Gutenberg functions.
add_action( 'after_setup_theme', 'course_maker_gutenberg_functions' );
/**
* Adds Gutenberg functions to the theme
*/
function course_maker_gutenberg_functions() {
require_once get_stylesheet_directory() . '/lib/gutenberg-functions.php';
}
// Load Scripts and Styles.
require_once CHILD_THEME_DIR . '/lib/load-scripts.php';
// Output Customizer Colors CSS.
require_once CHILD_THEME_DIR . '/lib/output-colors.php';
// Display Posts Shortcode.
if ( is_plugin_active( 'display-posts-shortcode/display-posts-shortcode.php' ) ) {
include_once CHILD_THEME_DIR . '/lib/dps-functions.php';
}
// Output for LifterLMS plugin.
if ( is_plugin_active( 'lifterlms/lifterlms.php' ) ) {
include_once CHILD_THEME_DIR . '/lib/lifterlms-functions.php';
include_once CHILD_THEME_DIR . '/lib/output-lifterlms.php';
}
// Output for WooCommerce plugin.
if ( class_exists( 'WooCommerce' ) ) {
include_once CHILD_THEME_DIR . '/lib/output-woocommerce.php';
}
// Output for MemberPress plugin.
if ( class_exists( 'MeprUser' ) ) {
include_once CHILD_THEME_DIR . '/lib/output-memberpress.php';
}
// Output for Restrict Content Pro plugin.
if ( class_exists( 'RCP_Member' ) ) {
include_once CHILD_THEME_DIR . '/lib/output-rcp.php';
}