-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfunctions.php
85 lines (74 loc) · 2.2 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
<?php
/**
* This file adds actions, filters, and functions to the Aegis theme.
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package aegis
* @author Atmostfear Entertainment
* @license GNU General Public License v2 or later
* @link https://github.com/atmostfear-entertainment/aegis
* @since 1.0.0
*/
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since 1.0.0
*
* @return void
*/
function aegis_support()
{
// Remove WordPress Block Patterns.
remove_theme_support('core-block-patterns');
// Enqueue editor styles.
add_editor_style('style.css');
}
add_action('after_setup_theme', 'aegis_support');
/*
* Query whether WooCommerce is activated.
*/
function aegis_is_woocommerce_activated()
{
if (class_exists('woocommerce')) {
return true;
} else {
return false;
}
}
/**
* Enqueue styles.
*
* @since 1.0.0
*
* @return void
*/
function aegis_styles()
{
wp_enqueue_style('aegis-styles', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get('Version'));
// Animations CSS.
wp_enqueue_style('aegis-animations-styles', get_template_directory_uri() . '/assets/css/animations.css', array(), wp_get_theme()->get('Version'));
// Global script.
wp_enqueue_script('aegis-global-script', get_template_directory_uri() . '/assets/js/index.js', array('jquery'), wp_get_theme()->get('Version'), true);
// Animations script.
wp_enqueue_script('aegis-animations-script', get_template_directory_uri() . '/assets/js/animations.js', array('jquery'), wp_get_theme()->get('Version'), true);
}
add_action('wp_enqueue_scripts', 'aegis_styles');
// Add block pattern.
require get_template_directory() . '/inc/block-patterns.php';
// Block styles.
require get_template_directory() . '/inc/block-styles.php';
/**
* Include Woocommerce support.
*/
if (class_exists('Woocommerce')) {
require get_template_directory() . '/inc/woocommerce/functions.php';
}
/*
* Enqueue Dashicons for use with block styles.
*/
function aegis_enqueue_block_dashicons()
{
wp_enqueue_style('dashicons');
}
add_action('enqueue_block_assets', 'aegis_enqueue_block_dashicons');