Enqueue Files to Header or Footer

Add information to enqueue to choose where your scripts and styles load.

Header:

wp_register_style('countdown-css',get_bloginfo('stylesheet_directory').'/js/jquery.countdown.css', null, false );
wp_enqueue_style('countdown-css',get_bloginfo('stylesheet_directory').'/js/jquery.countdown.css', null, false);
wp_register_script( 'countdown-plugin',get_bloginfo('stylesheet_directory').'/js/jquery.plugin.min.js', array( 'jquery' ), null, false);
wp_enqueue_script('countdown-plugin');

Footer:

wp_register_style('countdown-css',get_bloginfo('stylesheet_directory').'/js/jquery.countdown.css', null, true );
wp_enqueue_style('countdown-css',get_bloginfo('stylesheet_directory').'/js/jquery.countdown.css', null, true);
wp_register_script( 'countdown-plugin',get_bloginfo('stylesheet_directory').'/js/jquery.plugin.min.js', array( 'jquery' ), null, true);
wp_enqueue_script('countdown-plugin');

Source.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.