twentyfourteen_scripts

Enqueue scripts and styles for the front end.

Description

twentyfourteen_scripts(); 

Usage

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

Defined (1)

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

/functions.php  
  1. function twentyfourteen_scripts() { 
  2. // Add Lato font, used in the main stylesheet. 
  3. wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null ); 
  4.  
  5. // Add Genericons font, used in the main stylesheet. 
  6. wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.0.3' ); 
  7.  
  8. // Load our main stylesheet. 
  9. wp_enqueue_style( 'twentyfourteen-style', get_stylesheet_uri() ); 
  10.  
  11. // Load the Internet Explorer specific stylesheet. 
  12. wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20131205' ); 
  13. wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' ); 
  14.  
  15. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 
  16. wp_enqueue_script( 'comment-reply' ); 
  17.  
  18. if ( is_singular() && wp_attachment_is_image() ) { 
  19. wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' ); 
  20.  
  21. if ( is_active_sidebar( 'sidebar-3' ) ) { 
  22. wp_enqueue_script( 'jquery-masonry' ); 
  23.  
  24. if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { 
  25. wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131205', true ); 
  26. wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( 
  27. 'prevText' => __( 'Previous', 'twentyfourteen' ),  
  28. 'nextText' => __( 'Next', 'twentyfourteen' ) 
  29. ) ); 
  30.  
  31. wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150315', true );