forked from fairpm/fair-parent-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
119 lines (102 loc) · 3.2 KB
/
functions.php
File metadata and controls
119 lines (102 loc) · 3.2 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/**
* Gather all bits and pieces together.
* If you end up having multiple post types, taxonomies,
* hooks and functions - please split those to their
* own files under /inc and just require here.
*
* @Date: 2019-10-15 12:30:02
* @Last Modified by: Roni Laukkarinen
* @Last Modified time: 2024-01-10 18:54:48
*
* @package fair-parent
*/
namespace Fair_Parent;
/**
* The current version of the theme.
*/
define( 'FAIR_PARENT_VERSION', '1.0.0' );
// We need to have some defaults as comments or empties so let's allow this:
// phpcs:disable Squiz.Commenting.InlineComment.SpacingBefore, WordPress.Arrays.ArrayDeclarationSpacing.SpaceInEmptyArray
/**
* Theme settings
*/
add_action( 'after_setup_theme', function() {
$theme_settings = [
/**
* Theme textdomain
*/
'textdomain' => 'fair-parent-theme',
/**
* Content width
*/
'content_width' => 800,
/**
* Logo and featured image
*/
'default_featured_image' => null,
'logo' => '/svg/logo.svg',
/**
* All links are checked with JS, if those direct to external site and if,
* indicator of that is included. Exclude domains from that check in this array.
*/
'external_link_domains_exclude' => [
'localhost:8888',
'localhost:8889',
],
/**
* Menu locations
*/
'menu_locations' => [
'primary' => __( 'Primary Menu', 'fair-parent-theme' ),
],
// Restrict to only selected blocks
//
// Options: 'none', 'all', 'all-core-blocks',
// or any specific block or a combination of these
// Accepts both string (all*/none-options only) and array (options + specific blocks)
'allowed_blocks' => [
'post' => [
'core/column',
'core/columns',
'core/coverImage',
'core/embed',
'core/freeform',
'core/gallery',
'core/heading',
'core/html',
'core/image',
'core/list',
'core/list-item',
'core/paragraph',
'core/quote',
'core/block',
'core/table',
'core/textColumns',
],
'page' => [],
],
// If you want to use classic editor somewhere, define it here
'use_classic_editor' => [],
// Add your own settings and use them wherever you need, for example THEME_SETTINGS['my_custom_setting']
'my_custom_setting' => true,
];
$theme_settings = apply_filters( 'fair_parent_theme_settings', $theme_settings );
define( 'THEME_SETTINGS', $theme_settings );
} ); // end action after_setup_theme
/**
* Required files
*/
require get_theme_file_path( '/inc/hooks.php' );
require get_theme_file_path( '/inc/includes.php' );
require get_theme_file_path( '/inc/template-tags.php' );
// Run theme setup
add_action( 'after_setup_theme', __NAMESPACE__ . '\theme_setup' );
add_action( 'after_setup_theme', __NAMESPACE__ . '\build_theme_support' );
// Add Linux Foundation Banner
add_action( 'wp_body_open', __NAMESPACE__ . '\fair_linux_banner' );
//Remove Gutenberg Block Library CSS from loading on the frontend
function fair_remove_wp_block_library_css(){
wp_dequeue_style( 'wp-block-library-theme' );
}
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\fair_remove_wp_block_library_css', 100 );