feat: create child theme with brandbook styles and fonts
GeneratePress child theme bitwms-child with full brandbook CSS (corporate pink #E50071, Suisse Int'l typography, utility classes), PHP bootstrap, and sidebar navigation JS placeholder ready for Task 3. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* БИТ.WMS Child Theme — functions.php
|
||||
*
|
||||
* Bootstraps the child theme: enqueues parent GeneratePress styles,
|
||||
* enqueues the child theme stylesheet, and loads include files.
|
||||
*
|
||||
* @package bitwms-child
|
||||
* @version 1.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Prevent direct access.
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 1. Enqueue parent + child styles
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'bitwms_child_enqueue_styles' );
|
||||
|
||||
function bitwms_child_enqueue_styles() {
|
||||
// Parent GeneratePress stylesheet.
|
||||
wp_enqueue_style(
|
||||
'generatepress-style',
|
||||
get_template_directory_uri() . '/style.css',
|
||||
array(),
|
||||
wp_get_theme( 'generatepress' )->get( 'Version' )
|
||||
);
|
||||
|
||||
// Child theme stylesheet — depends on parent.
|
||||
wp_enqueue_style(
|
||||
'bitwms-child-style',
|
||||
get_stylesheet_uri(),
|
||||
array( 'generatepress-style' ),
|
||||
wp_get_theme()->get( 'Version' )
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 2. Load include files
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
$bitwms_includes = array(
|
||||
'inc/enqueue.php',
|
||||
);
|
||||
|
||||
foreach ( $bitwms_includes as $bitwms_file ) {
|
||||
$bitwms_path = get_stylesheet_directory() . '/' . $bitwms_file;
|
||||
if ( file_exists( $bitwms_path ) ) {
|
||||
require_once $bitwms_path;
|
||||
}
|
||||
}
|
||||
unset( $bitwms_file, $bitwms_path );
|
||||
Reference in New Issue
Block a user