Enqueue files from theme
-
I am trying to enqueue some files. I have seen many ways to do it and none are working. Can someone tell me how to load a file from my theme folder?
I have this on my page: <script> $( document ).ready( wpb_adding_scripts ); $( window ).load( wpb_adding_scripts ); </script> In my functions file I have: function wpb_adding_scripts() { wp_register_script('thickbox', get_stylesheet_directory_uri().'/_js/thickbox.js',array( 'jquery')); wp_register_script('jqFancyTransitions', get_stylesheet_directory_uri(__FILE__ ) . '/_js/jqFancyTransitions.1.8.min.js', array('jquery'),'1.8', true); wp_register_script('functions', get_stylesheet_directory_uri(). '/_js/functions.js', array('jquery'),'1.8', true) ; } add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
The topic ‘Enqueue files from theme’ is closed to new replies.