-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
68 lines (62 loc) · 1.73 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
<?php
/**
* Child Theme functions
*
* @author Eoxia <[email protected]>
* @link https://developer.wordpress.org/themes/basics/theme-functions/
* @since 3.0.0
* @package beflex-child
*/
/**
* Enqueue style of parent
*
* @method theme_enqueue_styles
* @return void
*/
function theme_enqueue_styles() {
wp_enqueue_style( 'beflex-parent-style', get_template_directory_uri() . '/assets/css/style.min.css', array(), wp_get_theme()->get( 'Version' ) );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
/**
* Enqueue style of child
*
* @method theme_enqueue_styles
* @return void
*/
function theme_child_enqueue_style() {
/** Styles */
wp_enqueue_style( 'beflex-child-style', get_stylesheet_directory_uri() . '/assets/css/style.min.css' );
wp_enqueue_style( 'custom-child-style', get_stylesheet_directory_uri() . '/style.css' );
/** Scripts */
wp_enqueue_script( 'beflex-child-js', get_stylesheet_directory_uri() . '/assets/js/theme.js' );
}
add_action( 'wp_enqueue_scripts', 'theme_child_enqueue_style', 11 );
/**
* Save ACF fields in child theme
*
* @method save_acf_child
* @return string
*/
function save_acf_child() {
return get_stylesheet_directory() . '/acf-json';
}
add_filter( 'acf/settings/save_json', 'save_acf_child' );
/**
* Load ACF fields of the parent theme
*
* @method load_acf_parent
* @param Array $paths paths of files.
* @return Array $paths paths of files.
*/
function load_acf_parent( $paths ) {
if ( is_child_theme() ) {
$paths[] = get_template_directory() . '/acf-json';
$paths[] = get_stylesheet_directory() . '/acf-json';
}
return $paths;
}
add_filter( 'acf/settings/load_json', 'load_acf_parent' );
// Blocks
require_once 'inc/blocks.php';
// Patterns
require_once 'inc/block-patterns.php';