WP test container created
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* TLIG theme setup.
|
||||
*
|
||||
* @package TLIG
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
const TLIG_VERSION = '0.1.0';
|
||||
|
||||
require_once __DIR__ . '/inc/nav.php';
|
||||
require_once __DIR__ . '/inc/nav-fields.php';
|
||||
require_once __DIR__ . '/inc/demo-languages.php';
|
||||
|
||||
/**
|
||||
* Theme supports and menu locations.
|
||||
*
|
||||
* One location, not two. The site it replaces maintains a separate desktop tree
|
||||
* (UberMenu) and mobile tree (ShiftNav) per language — 27 menus, which is why
|
||||
* German, Polish and Arabic have no mobile menu at all. Here one tree renders
|
||||
* both; the panel simply stacks below the tablet breakpoint.
|
||||
*/
|
||||
function tlig_setup(): void {
|
||||
add_theme_support( 'title-tag' );
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
add_theme_support( 'html5', [ 'search-form', 'gallery', 'caption', 'style', 'script' ] );
|
||||
|
||||
register_nav_menus( [
|
||||
'primary' => __( 'Primary navigation', 'tlig' ),
|
||||
] );
|
||||
|
||||
load_theme_textdomain( 'tlig', get_template_directory() . '/languages' );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'tlig_setup' );
|
||||
|
||||
/**
|
||||
* The stylesheet is built by Vite into assets/tlig.css.
|
||||
*
|
||||
* Versioned by filemtime so each build busts the browser cache — the same
|
||||
* approach the old child theme uses for tlig_en.css.
|
||||
*/
|
||||
function tlig_enqueue_assets(): void {
|
||||
$rel = '/assets/tlig.css';
|
||||
$path = get_template_directory() . $rel;
|
||||
|
||||
if ( ! file_exists( $path ) ) {
|
||||
return; // Not built yet; say nothing rather than enqueue a 404.
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'tlig', get_template_directory_uri() . $rel, [], (string) filemtime( $path ) );
|
||||
|
||||
$js = get_template_directory() . '/assets/tlig.js';
|
||||
|
||||
if ( file_exists( $js ) ) {
|
||||
wp_enqueue_script(
|
||||
'tlig',
|
||||
get_template_directory_uri() . '/assets/tlig.js',
|
||||
[],
|
||||
(string) filemtime( $js ),
|
||||
[ 'strategy' => 'defer' ]
|
||||
);
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'tlig_enqueue_assets' );
|
||||
Reference in New Issue
Block a user