Question

I am developing a child theme based on the roots theme. I created a front-page.php and added the following. I test that the page is loaded because I see the I am loaded text. However, the scripts are not loaded. What is wrong with my setup?

<?php
function dd_register_scripts() {
    wp_register_script(
        'something',
        get_template_directory_uri() . '/assets/js/something.min.js', array('jquery'), null, false
    );
}


function dd_enqueue_scripts() { 
    wp_enqueue_script('something'); 
}

add_action('init', 'dd_register_scripts');
add_action('wp_enqueue_scripts', 'dd_enqueue_scripts');
?>
<div id="asd">I am loaded</div>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top