mirror of
https://gh.wpcy.net/https://github.com/fairpm/fair-parent-theme.git
synced 2026-04-27 21:10:54 +08:00
119 lines
No EOL
3.2 KiB
PHP
119 lines
No EOL
3.2 KiB
PHP
<?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 ); |