__( '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' );