I'm just moving a theme from Vercel that done in HTML/CSS/Bootstrap/Nuxt.js to be deployed in WordPress trying to enqueue the css files and js but doesn't load at all the content of front-page.php and the header.php get displayed but without styling just dummy html and the path seem pretty correct if I open the files of the theme itself in the browser it's rendering normally.
if (!function_exists('setup_robertson_theme')) :
/**
* Sets up theme defaults and registers support for various
* WordPress features.
*
* Note that this function is hooked into the after_setup_theme
* hook, which runs before the init hook. The init hook is too late
* for some features, such as indicating support post thumbnails.
*/
function setup_robertson_theme()
{
add_action('wp_enqueue_scripts', 'add_theme_scripts');
wp_enqueue_style('style', get_stylesheet_uri());
/**
* Make theme available for translation.
* Translations can be placed in the /languages/ directory.
*/
load_theme_textdomain('robertson_theme', get_template_directory() . '/languages');
/**
* Add default posts and comments RSS feed links to <head>.
*/
add_theme_support('automatic-feed-links');
/**
* Enable support for post thumbnails and featured images.
*/
add_theme_support('post-thumbnails');
/**
* Add support for two custom navigation menus.
*/
register_nav_menus(array(
'primary' => __('Primary Menu', ' robertson_theme'),
'secondary' => __('Secondary Menu', 'myfirsttheme'),
));
/**
* Enable support for the following post formats:
* aside, gallery, quote, image, and video
*/
add_theme_support('post-formats', array('aside', 'gallery', 'quote', 'image', 'video'));
get_header();
}
endif; // setup_robertson_theme
add_action('after_setup_theme', 'setup_robertson_theme');
function add_theme_scripts()
{
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_style('style2', get_theme_file_uri() . '/style.css');
wp_enqueue_script('script1', get_template_directory_uri() . '/_nuxt/default.9609efb5.js', array('jquery'), 1.1, true);
wp_enqueue_script('script2', get_template_directory_uri() . '/_nuxt/entry.fe69eefa.js', array('jquery'), 1.1, true);
wp_enqueue_script('script3', get_template_directory_uri() . '/_nuxt/nuxt-link.bd1ab28f.js', array('jquery'), 1.1, true);
// if (is_singular() && comments_open() && get_option('thread_comments')) {
// wp_enqueue_script('comment-reply');
// }
}
add_action('wp_enqueue_scripts', 'add_theme_scripts');