mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-14 22:35:45 +03:00
Theme 2024: Initial commit of new theme
This commit is contained in:
parent
50c21b4e85
commit
512d7ba421
17 changed files with 318 additions and 4 deletions
32
themes/wporg-5ftf-2024/functions.php
Normal file
32
themes/wporg-5ftf-2024/functions.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
namespace WordPressDotOrg\Theme\FiveForTheFuture_2024;
|
||||
|
||||
require_once __DIR__ . '/inc/block-config.php';
|
||||
|
||||
/**
|
||||
* Actions and filters.
|
||||
*/
|
||||
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
|
||||
|
||||
/**
|
||||
* Enqueue scripts and styles.
|
||||
*/
|
||||
function enqueue_assets() {
|
||||
$asset_file = get_theme_file_path( 'build/style/index.asset.php' );
|
||||
if ( ! file_exists( $asset_file ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The parent style is registered as `wporg-parent-2021-style`, and will be loaded unless
|
||||
// explicitly unregistered. We can load any child-theme overrides by declaring the parent
|
||||
// stylesheet as a dependency.
|
||||
|
||||
$metadata = require $asset_file;
|
||||
wp_enqueue_style(
|
||||
'wporg-5ftf-2024',
|
||||
get_theme_file_uri( 'build/style/style-index.css' ),
|
||||
array( 'wporg-parent-2021-style', 'wporg-global-fonts' ),
|
||||
$metadata['version']
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue