twentyfifteen_scripts

Enqueue scripts and styles.

Description

twentyfifteen_scripts(); 

Usage

  1. if ( !function_exists( 'twentyfifteen_scripts' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = twentyfifteen_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function twentyfifteen_scripts() { 
  2. // Add custom fonts, used in the main stylesheet. 
  3. wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null ); 
  4.  
  5. // Add Genericons, used in the main stylesheet. 
  6. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.2' ); 
  7.  
  8. // Load our main stylesheet. 
  9. wp_enqueue_style( 'twentyfifteen-style', get_stylesheet_uri() ); 
  10.  
  11. // Load the Internet Explorer specific stylesheet. 
  12. wp_enqueue_style( 'twentyfifteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfifteen-style' ), '20141010' ); 
  13. wp_style_add_data( 'twentyfifteen-ie', 'conditional', 'lt IE 9' ); 
  14.  
  15. // Load the Internet Explorer 7 specific stylesheet. 
  16. wp_enqueue_style( 'twentyfifteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentyfifteen-style' ), '20141010' ); 
  17. wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' ); 
  18.  
  19. wp_enqueue_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20141010', true ); 
  20.  
  21. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 
  22. wp_enqueue_script( 'comment-reply' ); 
  23.  
  24. if ( is_singular() && wp_attachment_is_image() ) { 
  25. wp_enqueue_script( 'twentyfifteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141010' ); 
  26.  
  27. wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true ); 
  28. wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array( 
  29. 'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>',  
  30. 'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>',  
  31. ) );