php - wordpress wp_enqueque not working -
i have simple question. function.php enqueque code:
/** *enqueue styles. */ function circle_scripts() { //load css wp_enqueue_style( 'font-body', 'http://fonts.googleapis.com/css?family=michroma' ); wp_register_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '1.0', 'all' ); wp_enqueue_style( 'bootstrap-style' ); wp_register_style( 'animate', get_template_directory_uri() . '/css/animate.css', array(), '1.0', 'all' ); wp_enqueue_style( 'animate' ); wp_register_style( 'mycss', get_stylesheet_uri() ); wp_enqueue_style( 'mycss' ); //load js wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', get_template_directory_uri() . '/js/jquery-1.11.3.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'jquery' ); wp_register_script( 'bootstrap-plugin', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'bootstrap-plugin' ); wp_register_script( 'backtop', get_template_directory_uri() . '/js/jquery.backtop.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'backtop' ); wp_register_script( 'wow', get_template_directory_uri() . '/js/wow.min.js', array(), '1.0.0', true ); wp_enqueue_script( 'wow' ); wp_register_script( 'myscript', get_template_directory_uri() . '/js/myjs.js', array(), '1.0.0', true ); wp_enqueue_script( 'myscript' ); } add_action( 'wp_enqueque_scripts', 'circle_scripts' );
but code doesn't work, not load css , js file. if separate enqueque_style , enqueque_script , call in header.php , footer.php 2 function created in function.php work.
you spelled name of hook wrong (enqueque
should enqueue
). should add following action:
add_action( 'wp_enqueue_scripts', 'circle_scripts' );
Comments
Post a Comment