storefront theme child and wp_enqueue_scripts
-
I registered a storefront child theme. From function.php I add class with require if is_admin ().
I am looking to load a js script with wp_enqueue_scripts. in the constructor of my classadd_action ('wp_enqueue_scripts', array ($ this, 'add_books_author_js'));
my function
public function add_books_author_js () { wp_deregister_script ('books-author-js'); wp_register_script ( 'books-author-js', get_stylesheet_directory_uri (). '/assets/js/books-author.js', array ('jquery', 'jquery-ui-autocomplete'), '1.0', false ); wp_enqueue_script ('books-author-js'); }
it doesn’t work and if I copy the code into the class class-storefront-admin.php it works fine
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘storefront theme child and wp_enqueue_scripts’ is closed to new replies.