layers_scripts

The Layers layers scripts function.

Description

layers_scripts(); 

Usage

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

Defined (1)

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

/functions.php  
  1. function layers_scripts() { 
  2.  
  3. /** 
  4. * Front end Scripts 
  5. */ 
  6.  
  7. wp_enqueue_script( 
  8. LAYERS_THEME_SLUG . '-plugins' ,  
  9. get_template_directory_uri() . '/assets/js/plugins.js',  
  10. array( 
  11. 'jquery',  
  12. ),  
  13. ); // Sticky-Kit 
  14.  
  15. wp_enqueue_script( 
  16. LAYERS_THEME_SLUG . '-framework' ,  
  17. get_template_directory_uri() . '/assets/js/layers.framework.js',  
  18. array( 
  19. 'jquery',  
  20. ),  
  21. ); // Framework 
  22.  
  23. wp_localize_script( LAYERS_THEME_SLUG . '-framework', 'layers_script_settings', array( 
  24. 'header_sticky_breakpoint' => apply_filters( 'layers_sticky_header_breakpoint', 270 ),  
  25. ) ); 
  26.  
  27. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 
  28. wp_enqueue_script( 'comment-reply' ); 
  29. } // Comment reply script 
  30.  
  31. // Google Maps 
  32. wp_register_script( 
  33. LAYERS_THEME_SLUG . '-map-api',  
  34. '//maps.googleapis.com/maps/api/js?key=' . layers_get_theme_mod( 'google-maps-api' ) 
  35. ); 
  36. wp_register_script( 
  37. LAYERS_THEME_SLUG . '-map-trigger',  
  38. get_template_directory_uri().'/core/widgets/js/maps.js',  
  39. array( 'jquery' ),  
  40. ); 
  41.  
  42. /** 
  43. * Front end Styles 
  44. */ 
  45.  
  46. wp_enqueue_style( 
  47. LAYERS_THEME_SLUG . '-framework' ,  
  48. get_template_directory_uri() . '/assets/css/framework.css',  
  49. array() ,  
  50. ); 
  51.  
  52. wp_enqueue_style( 
  53. LAYERS_THEME_SLUG . '-components',  
  54. get_template_directory_uri() . '/assets/css/components.css',  
  55. array(),  
  56. ); // Compontents 
  57.  
  58. wp_enqueue_style( 
  59. LAYERS_THEME_SLUG . '-responsive',  
  60. get_template_directory_uri() . '/assets/css/responsive.css',  
  61. array(),  
  62. ); // Responsive 
  63.  
  64. wp_enqueue_style( 
  65. LAYERS_THEME_SLUG . '-icon-fonts',  
  66. get_template_directory_uri() . '/assets/css/layers-icons.css',  
  67. array(),  
  68. ); // Icon Font 
  69.  
  70. if( class_exists( 'WooCommerce' ) ) { 
  71. wp_enqueue_style( 
  72. LAYERS_THEME_SLUG . '-woocommerce',  
  73. get_template_directory_uri() . '/assets/css/woocommerce.css',  
  74. array(),  
  75. ); // Woocommerce 
  76.  
  77. if( is_admin_bar_showing() ) { 
  78. wp_enqueue_style( 
  79. LAYERS_THEME_SLUG . '-admin',  
  80. get_template_directory_uri() . '/core/assets/icons.css',  
  81. array(),  
  82. ); // Admin CSS 
  83.  
  84. wp_register_style( 
  85. LAYERS_THEME_SLUG . '-font-awesome',  
  86. get_template_directory_uri() . '/core/assets/plugins/font-awesome/font-awesome.min.css',  
  87. array(),  
  88. ); // Font Awesome 
  89.  
  90.  
  91. // Swiper Slider 
  92. wp_register_script( 
  93. LAYERS_THEME_SLUG . '-slider-js',  
  94. get_template_directory_uri() . '/core/widgets/js/swiper.js',  
  95. array( 'jquery' ),  
  96. ); 
  97. wp_register_style( 
  98. LAYERS_THEME_SLUG . '-slider',  
  99. get_template_directory_uri() . '/core/widgets/css/swiper.css',  
  100. array(),  
  101. ); 
  102.  
  103. // Layers Masonry. 
  104. wp_register_script( 
  105. LAYERS_THEME_SLUG . '-layers-masonry-js',  
  106. get_template_directory_uri() . '/assets/js/layers.masonry.js',  
  107. array( 
  108. 'jquery',  
  109. 'masonry', // Wordpress Masonry 
  110. ),  
  111. ); 
  112.