-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
75 lines (65 loc) · 1.93 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
<?php
add_action( 'wp_enqueue_scripts', function() {
// Enqueue theme stylesheet.
wp_enqueue_style(
'ankur-eichefam-style',
get_stylesheet_directory_uri() . '/assets/css/theme.css',
array(),
filemtime( get_stylesheet_directory() . '/assets/css/theme.css' )
);
// Enqueue CodyFrame Util helper script.
wp_enqueue_script(
'ankur-eichefam-util',
get_stylesheet_directory_uri() . '/assets/js/util.js',
array(),
filemtime( get_stylesheet_directory() . '/assets/js/util.js' ),
true
);
// Enqueue theme script.
wp_enqueue_script(
'ankur-eichefam-script',
get_stylesheet_directory_uri() . '/assets/js/theme.js',
array( 'ankur-eichefam-util' ),
filemtime( get_stylesheet_directory() . '/assets/js/theme.js' ),
true
);
// Enqueue Algolia autocomplete script.
wp_enqueue_script(
'ankur-eichefam-autocomplete',
get_stylesheet_directory_uri() . '/assets/js/autocomplete.js',
array(),
filemtime( get_stylesheet_directory() . '/assets/js/autocomplete.js' ),
true
);
} );
/**
* Additional editor styles.
* Using `add_editor_style` doesn't allow the styles to be inherited by child themes.
*
* @since 1.0.0
*/
add_action( 'enqueue_block_editor_assets', function() {
wp_enqueue_style(
'ankur-eichefam-editor-style',
get_template_directory_uri() . '/assets/css/editor.css',
array(),
wp_get_theme()->get( 'Version' )
);
} );
// Algolia custom template path, including trailing slash.
// @link https://community.algolia.com/wordpress/customize-templates.html#customize-templates-folder-name
add_filter( 'algolia_templates_path', function() {
return 'templates/algolia/';
} );
add_filter( 'algolia_post_images_sizes', function( $sizes ) {
$sizes[] = 'large';
return $sizes;
} );
add_action( 'enqueue_block_editor_assets', function() {
wp_enqueue_script(
'ankur-eichefam-custom-icons',
get_theme_file_uri( '/assets/js/register-custom-icons.js' ),
array( 'wp-i18n', 'wp-hooks', 'wp-dom' ),
true
);
} );