katstar01
1/31/2017 - 7:07 PM

This snippet is used for enqueueing scripts and styles into a WordPress plugin

This snippet is used for enqueueing scripts and styles into a WordPress plugin

<?php

function KE_load_scripts() {
  
  /* Keeping the file path stored in a variable
  *  will keep things looking cleaner and easier 
  *  to read
  */
  $stylesheet_url = plugins_url('/stylesheet.css', __FILE__ );
  
   wp_enqueue_style('namespace', $stylesheet_url);
}

add_action('wp_enqueue_scripts', 'KE_load_scripts');

?>