evolve_media

Functions - general template functions that are used throughout EvoLve.

Description

evolve_media(); 

Usage

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

Defined (1)

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

/library/functions/functions.php  
  1. function evolve_media() { 
  2. global $evl_options; 
  3. $evolve_template_url = get_template_directory_uri(); 
  4.  
  5. $evolve_css_data = ''; 
  6.  
  7. $evolve_pagination_type = evolve_get_option('evl_pagination_type', 'pagination'); 
  8. $evolve_pos_button = evolve_get_option('evl_pos_button', 'right'); 
  9. $evolve_carousel_slider = evolve_get_option('evl_carousel_slider', '1'); 
  10. $evolve_parallax_slider = evolve_get_option('evl_parallax_slider_support', '1'); 
  11. $evolve_status_gmap = evolve_get_option('evl_status_gmap', '1'); 
  12. $evolve_recaptcha_public = evolve_get_option('evl_recaptcha_public', ''); 
  13. $evolve_recaptcha_private = evolve_get_option('evl_recaptcha_private', ''); 
  14. $evolve_fontawesome = evolve_get_option('evl_fontawesome', '0'); 
  15. $evolve_responsive_menu = evolve_get_option('evl_responsive_menu', 'icon'); 
  16. $evolve_responsive_menu_layout = evolve_get_option('evl_responsive_menu_layout', 'basic'); 
  17. $evolve_google_map_api = evolve_get_option('evl_google_map_api', ''); 
  18.  
  19. if (is_admin()) 
  20. return; 
  21.  
  22. wp_enqueue_script('jquery'); 
  23.  
  24. if ($evolve_parallax_slider == "1") { 
  25. wp_enqueue_script('parallax', EVOLVEJS . '/parallax/parallax.js'); 
  26. wp_enqueue_style('parallaxcss', EVOLVEJS . '/parallax/parallax.css'); 
  27. wp_enqueue_script('modernizr', EVOLVEJS . '/parallax/modernizr.js'); 
  28.  
  29. if ($evolve_carousel_slider == "1") { 
  30. wp_enqueue_script('carousel', EVOLVEJS . '/carousel.js'); 
  31. wp_enqueue_script('tipsy', EVOLVEJS . '/tipsy.js', array('jquery')); 
  32. wp_enqueue_script('fields', EVOLVEJS . '/fields.js', array('jquery')); 
  33. wp_enqueue_script('tabs', EVOLVEJS . '/tabs.js', array('jquery'), '', true); 
  34.  
  35. //if ($evolve_pagination_type == "infinite") { 
  36. wp_enqueue_script('jscroll', EVOLVEJS . '/jquery.infinite-scroll.min.js', array('jquery')); 
  37. //} 
  38.  
  39. if ($evolve_pos_button == "disable" || $evolve_pos_button == "") { 
  40.  
  41. } else { 
  42. wp_enqueue_script('jquery_scroll', EVOLVEJS . '/jquery.scroll.pack.js', array('jquery')); 
  43. wp_enqueue_script('supersubs', EVOLVEJS . '/supersubs.js', array('jquery')); 
  44. wp_enqueue_script('superfish', EVOLVEJS . '/superfish.js', array('jquery')); 
  45. wp_enqueue_script('buttons', EVOLVEJS . '/buttons.js', array('jquery')); 
  46. wp_enqueue_script('ddslick', EVOLVEJS . '/ddslick.js', array('jquery')); 
  47. wp_enqueue_script('meanmenu', EVOLVEJS . '/jquery.meanmenu.js', array('jquery')); 
  48. wp_enqueue_script('flexslider', EVOLVEJS . '/jquery.flexslider.js'); 
  49. wp_enqueue_script('flexslidermin', EVOLVEJS . '/jquery.flexslider-min.js'); 
  50. wp_enqueue_script('main', EVOLVEJS . '/main.js', array('jquery'), '', true); 
  51.  
  52. if ($evolve_status_gmap == "1") { 
  53. wp_enqueue_script('googlemaps', '//maps.googleapis.com/maps/api/js?key=' . $evolve_google_map_api . '&language=' . mb_substr(get_locale(), 0, 2)); 
  54. wp_enqueue_script('gmap', EVOLVEJS . '/gmap.js', array('jquery'), '', true); 
  55.  
  56. if ($evolve_recaptcha_public && $evolve_recaptcha_private) { 
  57. wp_enqueue_script('googlerecaptcha', 'https://www.google.com/recaptcha/api.js'); 
  58.  
  59. if ($evolve_fontawesome != "1") { 
  60. // FontAwesome  
  61. wp_enqueue_style('fontawesomecss', get_template_directory_uri() . '/assets/fonts/fontawesome/css/font-awesome.css', false); 
  62.  
  63. // Main Stylesheet 
  64. function evolve_styles() { 
  65.  
  66. wp_enqueue_style('maincss', get_stylesheet_uri(), false); 
  67.  
  68. require_once( get_template_directory() . '/custom-css.php' ); 
  69. wp_add_inline_style('bootstrapcsstheme', $evolve_css_data); 
  70.  
  71. $evolve_header_type = evolve_get_option('evl_header_type', 'none'); 
  72. switch ($evolve_header_type) { 
  73. case "none": 
  74. require_once( get_template_directory() . '/assets/css/header1.php' ); 
  75. break; 
  76. case "h1": 
  77. require_once( get_template_directory() . '/assets/css/header2.php' ); 
  78. break; 
  79. wp_add_inline_style('bootstrapcsstheme', $evolve_css_data); 
  80. wp_enqueue_style('meanmenu', get_template_directory_uri() . '/assets/css/shortcode/meanmenu.css'); 
  81.  
  82. add_action('wp_enqueue_scripts', 'evolve_styles'); 
  83.  
  84.  
  85. if (defined('ICL_LANGUAGE_CODE')) { 
  86. $language_code = ICL_LANGUAGE_CODE; 
  87. } else { 
  88. $language_code = ''; 
  89.  
  90. if ($evolve_responsive_menu == 'icon') { 
  91. $evolve_responsive_menu = '<span class="t4p-icon-menu"></span>'; 
  92. } elseif ($evolve_responsive_menu == 'text') { 
  93. $evolve_responsive_menu = evolve_get_option('evl_responsive_menu_text', 'Menu'); 
  94. } else { 
  95. $evolve_responsive_menu = ''; 
  96.  
  97. //$evl_portfolio_pagination_type = isset($evl_options['evl_portfolio_pagination_type']) ? $evl_options['evl_portfolio_pagination_type'] : ''; 
  98. $local_variables = array( 
  99. 'language_flag' => $language_code,  
  100. 'infinite_blog_finished_msg' => '<em>' . __('All posts displayed', 'evolve') . '</em>',  
  101. 'infinite_blog_text' => '<em>' . __('Loading the next set of posts...', 'evolve') . '</em>',  
  102. 'theme_url' => get_template_directory_uri(),  
  103. 'order_actions' => __('Details', 'evolve'),  
  104. ); 
  105.  
  106. global $woocommerce; 
  107.  
  108. if (class_exists('Woocommerce')) { 
  109. if (version_compare($woocommerce->version, '2.3', '>=')) { 
  110. $local_variables['woocommerce_23'] = true; 
  111.  
  112. wp_localize_script('main', 'js_local_vars', $local_variables); 
  113.  
  114. $responsive_menu_vars = array( 
  115. 'responsive_menu' => $evolve_responsive_menu,  
  116. 'responsive_menu_layout' => $evolve_responsive_menu_layout,  
  117. ); 
  118.  
  119. wp_localize_script('main', 'js_responsive_menu', $responsive_menu_vars);