-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
101 lines (84 loc) · 2.81 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* Twentynineteen-child Theme functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package twentynineteen-child
*/
add_action( 'wp_enqueue_scripts', 'twentynineteen_parent_theme_enqueue_styles' );
/**
* Enqueue scripts and styles.
*/
function twentynineteen_parent_theme_enqueue_styles() {
wp_enqueue_style( 'twentynineteen-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'twentynineteen-child-style',
get_stylesheet_directory_uri() . '/style.css',
array( 'twentynineteen-style' )
);
}
/*** Okay, now we'll get down to guten fun ***/
/*
* Theme Supports
*
* See: https://developer.wordpress.org/block-editor/developers/themes/theme-support/
*/
function twentynineteen_child_setup_theme_supported_features() {
// Add styles to Gutenberg editor.
add_theme_support( 'editor-styles' );
add_editor_style( 'editor-styles.css' );
// Gutenberg-specific theme supports.
// Apply default block styles on front end ?
//add_theme_support( 'wp-block-styles' );
// Enable wide alignment.
add_theme_support( 'align-wide' );
// Make embedded content responsive.
add_theme_support( 'responsive-embeds' );
// Do not permit font sizes to be set in editor.
add_theme_support('disable-custom-font-sizes');
// Deactivate custom coluors, to use only colours in palette.
add_theme_support( 'disable-custom-colors' );
// Colour palette.
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Primary', '' ),
'slug' => 'primary',
'color' => '#7654B4',
),
array(
'name' => __( 'Secondary', ''),
'slug' => 'secondary',
'color' => '#220B5E',
),
array(
'name' => __( 'Dark Gray', ''),
'slug' => 'dark-gray',
'color' => '#111',
),
array(
'name' => __( 'Light Gray', ''),
'slug' => 'light-gray',
'color' => '#767676',
),
array(
'name' => __( 'White', ''),
'slug' => 'white',
'color' => '#fff',
),
) );
}
add_action( 'after_setup_theme', 'twentynineteen_child_setup_theme_supported_features' );
/**
* Enqueue scripts for block filters.
*
* See: https://developer.wordpress.org/block-editor/developers/filters/block-filters/
*/
function twentynineteen_child_blocks_enqueue() {
wp_enqueue_script(
'twentynineteen-child-blocks',
get_stylesheet_directory_uri() . '/js/blocks.js',
array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' )
/* filemtime( get_template_directory_uri() . '/js/blocks.js' )*/
);
}
add_action( 'enqueue_block_editor_assets', 'twentynineteen_child_blocks_enqueue' );