-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
68 lines (56 loc) · 1.5 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
// Enqueue style.css
add_action('wp_enqueue_scripts', 'linkhub_enqueue_styles');
function linkhub_enqueue_styles()
{
wp_enqueue_style(
'linkhub-style',
get_stylesheet_uri()
);
}
// Enqueue block variations
add_action('enqueue_block_editor_assets', 'linkhub_enqueue_block_variations');
function linkhub_enqueue_block_variations()
{
wp_enqueue_script(
'linkhub-block-variations',
get_theme_file_uri('assets/js/block-variations.js'),
array(
'wp-blocks',
'wp-dom-ready',
'wp-i18n'
),
wp_get_theme()->get('Version'),
true
);
}
// Register block styles
add_action('init', 'linkhub_register_block_styles');
function linkhub_register_block_styles()
{
// Rounded style for site logo
register_block_style('core/site-logo', array(
'name' => 'rounded',
'label' => __('Rounded', 'linkhub'),
'inline_style' => '.wp-block-site-logo.is-style-rounded img {
border-radius: 100%;
}'
));
// Align center for summary
register_block_style('core/details', array(
'name' => 'align-center',
'label' => __('Align Center', 'linkhub'),
'inline_style' => '.wp-block-details.is-style-align-center {
text-align: center;
}'
));
}
// Register pattern category
add_action('init', 'linkhub_register_pattern_categories');
function linkhub_register_pattern_categories()
{
register_block_pattern_category('linkhub/patterns', array(
'label' => __('Linkhub Patterns', 'linkhub'),
'description' => __('Custom patterns for Linkhub theme.', 'linkhub')
));
}