Advertisement
lberelson

Enqueue Wordpress Mac

Jun 12th, 2015
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. function kc_enq_scripts_method (){
  2.     $stylesheetURI = get_stylesheet_directory_uri();
  3.     $templateURI = get_template_directory_uri();
  4.    // Get the main style.css from the child if it exists, parent if not
  5. wp_register_style( 'parent-style', $stylesheetURI  . '/css/bootstrap.min.css', false, '1.0', 'screen' );
  6. wp_enqueue_style( 'parent-style' );
  7.  
  8.   // Scripts typically don't get overwritten, so enqueue from parent theme
  9. wp_enqueue_script( 'bootstrap.min.js', $templateURI . '/js/bootstrap.min.js', array( 'jquery' ), '1.11.3', true );
  10. wp_enqueue_script('jquery');
  11. wp_enqueue_script( 'jquery.min.js', $templateURI . '/js/jquery.min.js',    array( 'jquery' ), '1.11.3', true );
  12. wp_enqueue_script( 'bootstrap.js', $templateURI . '/js/bootstrap.js',    array( 'jquery' ), '3.3.4', true );
  13. }
  14.  
  15. //only one call to hook per theme
  16. add_action( 'wp_enqueue_scripts', 'kc_enq_scripts_method', 9 );
  17.  
  18. //register menus etc follows
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement