responsive_mobile_js

A safe way of adding JavaScripts to a WordPress generated page.

Description

responsive_mobile_js(); 

Usage

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

Defined (1)

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

/includes/functions.php  
  1. function responsive_mobile_js() { 
  2.  
  3. global $is_IE; 
  4. $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; 
  5. $template_directory_uri = get_template_directory_uri(); 
  6.  
  7. // JS at the bottom for fast page loading. 
  8. wp_enqueue_script( 'responsive-scripts', $template_directory_uri . '/js/responsive-scripts' . $suffix . '.js', array( 'jquery' ), '1.2.5', true ); 
  9.  
  10. if ( $is_IE && ! wp_script_is( 'tribe-placeholder' ) ) { 
  11. wp_enqueue_script( 'jquery-placeholder', $template_directory_uri . '/core/js/jquery-placeholder' . $suffix . '.js', array( 'jquery' ), '2.0.7', true ); 
  12.  
  13. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 
  14. wp_enqueue_script( 'comment-reply' ); 
  15.  
  16. // Register Scripts so that it can be easily enqueued 
  17. wp_register_script( 'bootstrap', $template_directory_uri . '/core/bootstrap/javascripts/bootstrap' . $suffix . '.js', array( 'jquery' ), '3.1.1' ); 
  18. wp_register_script( 'responsive-mobile-menu', get_template_directory_uri() . '/core/js/mobile-menu' . $suffix . '.js', array( 'jquery' ), '20120206', true ); 
  19. wp_register_script( 'responsive-skip-link-focus-fix', get_template_directory_uri() . '/core/js/skip-link-focus-fix' . $suffix . '.js', array(), '20130115', true ); 
  20.