-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
64 lines (58 loc) · 2.37 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
<?php
/**
* ASU Divi Child Theme Theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package asu-divi
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
$uds_wp_includes = array(
'/enqueue.php', // Enqueues the correct child theme files.
'/asu-favicons.php', // Adds favicons directly to <head>
'/setup.php', // Theme setup options.
'/class-unity-react-header-ctabtn-walker.php', // Nav walker class specifically for the CTA buttons within the header.
'/class-unity-react-header-navtree-walker.php', // Nav walker class for the main navigation object within the header.
'/class-unity-react-footer-columns-walker.php', // Nav walker class for the footer menu items.
'/menu-cta-metabox.php', // Adds a meta box for CTA button colors to each menu item.
'/class-wp-social-media-walker.php', // Load custom WordPress nav walker for footer Social Media menu wdiget.
'/customizer.php', // Customizer additions.
'/render-partials.php', // Rendering methods for certain customizer-controlled items.
'/header-localize-script.php', // Pass header variables to React for rendering.
'/footer-localize-script.php' // Pass footer variables to React for rendering.
);
foreach ( $uds_wp_includes as $file ) {
require_once get_stylesheet_directory() . '/inc' . $file;
}
// Misc functions. These need a home eventually.
if ( ! function_exists( 'uds_wp_body_attributes' ) ) {
/**
* Displays the attributes for the body element.
*/
function uds_wp_body_attributes() {
/**
* Filters the body attributes.
*
* @param array $atts An associative array of attributes.
*/
$atts = array_unique( apply_filters( 'uds_wp_body_attributes', $atts = array() ) );
if ( ! is_array( $atts ) || empty( $atts ) ) {
return;
}
$attributes = '';
foreach ( $atts as $name => $value ) {
if ( $value ) {
$attributes .= sanitize_key( $name ) . '="' . esc_attr( $value ) . '" ';
} else {
$attributes .= sanitize_key( $name ) . ' ';
}
}
echo trim( $attributes ); // phpcs:ignore WordPress.Security.EscapeOutput
}
}
// Remove the [...] standard output for an excerpt.
function asu_divi_excerpt_more( $more ) {
return '';
}
add_filter('excerpt_more', 'asu_divi_excerpt_more');