REFACTOR using get_template_directory_uri to best handle assets and avoid boule eunqueu in child theme

This commit is contained in:
Antoine M 2025-06-10 15:54:56 +02:00
parent d23d611926
commit 927d0980bf

View File

@ -80,8 +80,8 @@ function carhop_enqueue_scripts()
{
$theme = wp_get_theme();
wp_enqueue_style('app-css', tailpress_asset('css/app.css'), array(), $theme->get('Version'));
wp_enqueue_script_module('app-js', tailpress_asset('js/app.js'), array(), $theme->get('Version'));
wp_enqueue_style('app-css', get_template_directory_uri() . '/css/app.css', array(), $theme->get('Version'));
wp_enqueue_script_module('app-js', get_template_directory_uri() . '/js/app.js', array(), $theme->get('Version'));
// wp_enqueue_style('swiper-css', 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css');
// wp_enqueue_script_module('swiper-js', 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js', array(), null, true);