-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
74 lines (68 loc) · 3.94 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
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:
if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
function chld_thm_cfg_locale_css( $uri ){
if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
$uri = get_template_directory_uri() . '/rtl.css';
return $uri;
}
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
if ( !function_exists( 'child_theme_configurator_css' ) ):
function child_theme_configurator_css() {
wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'twenty-twenty-one-style','twenty-twenty-one-style','twenty-twenty-one-print-style' ) );
}
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );
// END ENQUEUE PARENT ACTION
// Register our custom block
add_action('acf/init', 'my_acf_blocks_init');
function my_acf_blocks_init() {
if( function_exists('acf_register_block_type') ) {
acf_register_block_type(array(
'name' => 'jhl-split-image-block',
'title' => __('Split Image'),
'description' => __('Block with an image on one side, content on the other'),
'render_template' => 'template-parts/blocks/split-image/split-image.php',
'enqueue_style' => get_stylesheet_directory_uri() . '/template-parts/blocks/split-image/split-image.css',
'category' => 'layout',
'icon' => 'analytics',
'mode' => 'edit',
));
acf_register_block_type(array(
'name' => 'jhl-latest-posts-block',
'title' => __('Latest Posts'),
'description' => __('Block with an title, content, and latest posts'),
'render_template' => 'template-parts/blocks/latest-posts/latest-posts.php',
'enqueue_style' => get_stylesheet_directory_uri() . '/template-parts/blocks/latest-posts/latest-posts.css',
'category' => 'layout',
'icon' => 'analytics',
'mode' => 'edit',
));
acf_register_block_type(array(
'name' => 'slider',
'title' => __('Slider'),
'description' => __('ACF Slider w/large image support.'),
'render_template' => 'template-parts/blocks/slider/slider.php',
'category' => 'embed',
'icon' => 'format-gallery',
'keywords' => array( 'slider', 'gallery', 'carousel' ),
'align_content' => 'center',
'mode' => 'edit',
'enqueue_assets' => function(){
wp_enqueue_style( 'slider-slick', get_stylesheet_directory_uri() . '/template-parts/blocks/slider/slick.css' );
wp_enqueue_style( 'slider-slick-theme', get_stylesheet_directory_uri() . '/template-parts/blocks/slider/slick-theme.min.css' );
wp_enqueue_script( 'slider-slick', get_stylesheet_directory_uri() . '/template-parts/blocks/slider/slick.min.js', array('jquery'), '', true );
wp_enqueue_style( 'slider-slick-lightbox-theme', get_stylesheet_directory_uri() . '/template-parts/blocks/slider/slick-lightbox.min.css' );
wp_enqueue_script( 'slider-slick-lightbox', get_stylesheet_directory_uri() . '/template-parts/blocks/slider/slick-lightbox.min.js', array('jquery','slider-slick'), '', true );
wp_enqueue_script( 'slider-slick-init', get_stylesheet_directory_uri() . '/template-parts/blocks/slider/slick-init.js', array('jquery','slider-slick'), '', true );
},
));
}
}