onetone_custom_scripts

The Onetone onetone custom scripts function.

Description

onetone_custom_scripts(); 

Usage

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

Defined (1)

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

/includes/theme-setup.php  
  1. function onetone_custom_scripts() { 
  2.  
  3. global $page_meta, $post, $shop_style; 
  4.  
  5. if($post) { 
  6. $page_meta = get_post_meta( $post->ID , '_onetone_post_meta'); 
  7. }  
  8.  
  9. if( isset($page_meta[0]) && $page_meta[0]!='' ) 
  10. $page_meta = @json_decode( $page_meta[0], true ); 
  11.  
  12. $theme_info = wp_get_theme(); 
  13. $detect = new Mobile_Detect; 
  14.  
  15. wp_enqueue_style('font-awesome', get_template_directory_uri() .'/plugins/font-awesome/css/font-awesome.min.css', false, '4.3.0', false); 
  16. wp_enqueue_style('bootstrap', get_template_directory_uri() .'/plugins/bootstrap/css/bootstrap.min.css', false, '3.3.4', false); 
  17. wp_enqueue_style( 'owl.carousel', get_template_directory_uri() .'/plugins/owl-carousel/assets/owl.carousel.css', false, '2.2.0', false ); 
  18. wp_enqueue_style('prettyPhoto', get_template_directory_uri() .'/css/prettyPhoto.css', false, '3.1.5', false); 
  19.  
  20.  
  21. if( !onetone_is_plugin_active('magee-shortcodes/Magee.php') ) { 
  22. wp_enqueue_style('onetone-shortcodes', get_template_directory_uri() .'/css/shortcode.css', false, $theme_info->get( 'Version' ), false); 
  23.  
  24. wp_enqueue_style('onetone-animate', get_template_directory_uri() .'/css/animate.css', false, '3.5.1', false); 
  25.  
  26. wp_enqueue_style( 'onetone-main', get_stylesheet_uri(), array(), $theme_info->get( 'Version' ) ); 
  27. wp_enqueue_style('onetone-onetone', get_template_directory_uri() .'/css/onetone.css', false, $theme_info->get( 'Version' ), false); 
  28.  
  29. wp_enqueue_style('onetone-ms', get_template_directory_uri() .'/css/onetone-ms.css', false, $theme_info->get( 'Version' ), false); 
  30.  
  31. wp_enqueue_style('onetone-scheme', get_template_directory_uri() .'/css/scheme.less', false, $theme_info->get( 'Version' ), false); 
  32.  
  33. wp_enqueue_style('onetone-home', get_template_directory_uri() .'/css/home.css', false, $theme_info->get( 'Version' ), false); 
  34.  
  35. $is_rtl = false; 
  36. if ( is_rtl() ) { 
  37. wp_enqueue_style('onetone-rtl', get_template_directory_uri() .'/rtl.css', false, $theme_info->get( 'Version' ), false); 
  38. $is_rtl = true; 
  39.  
  40. $background_array = onetone_option("page_background"); 
  41. $background = onetone_get_background($background_array); 
  42. $header_image = get_header_image(); 
  43. $onetone_custom_css = ""; 
  44.  
  45. if (isset($header_image) && ! empty( $header_image )) { 
  46. $onetone_custom_css .= ".home-header{background:url(".$header_image. ") repeat;}\n"; 
  47. if ( 'blank' != get_header_textcolor() && '' != get_header_textcolor() ) { 
  48. $header_color = ' color:#' . get_header_textcolor() . ';'; 
  49. $onetone_custom_css .= 'header .site-name, header .site-description, header .site-tagline{'.$header_color.'}'; 
  50. else{ 
  51. $onetone_custom_css .= 'header .site-name, header .site-description, header .site-tagline{display:none;}';  
  52.  
  53.  
  54. $custom_css = onetone_option("custom_css"); 
  55. $onetone_custom_css .= '.site{'.$background.'}'; 
  56.  
  57. $links_color = onetone_option( 'links_color', '#37cadd'); 
  58.  
  59. //scheme 
  60. $primary_color = esc_attr(onetone_option('primary_color', $links_color));  
  61.  
  62. $links_color = onetone_option( 'links_color'); 
  63.  
  64. if($links_color ) 
  65. $onetone_custom_css .= '.entry-content a, .home-section-content a{color:'.$links_color.' ;}'; 
  66.  
  67. $top_menu_font_color = onetone_option( 'font_color'); 
  68.  
  69. if($top_menu_font_color !="" && $top_menu_font_color!=null) { 
  70. $onetone_custom_css .= 'header .site-nav > ul > li > a {color:'.$top_menu_font_color.'}'; 
  71.  
  72. // header 
  73. $sticky_header_background_color = esc_attr(onetone_option('sticky_header_background_color', '')); 
  74. $sticky_header_background_opacity = esc_attr(onetone_option('sticky_header_background_opacity', '1'));  
  75. $header_background_color = esc_attr(onetone_option('header_background_color')); 
  76. $header_background_opacity = esc_attr(onetone_option('header_background_opacity', '1'));  
  77. $header_border_color = esc_attr(onetone_option('header_border_color', ''));  
  78. $page_title_bar_background_color = esc_attr(onetone_option('page_title_bar_background_color', ''));  
  79. $page_title_bar_borders_color = esc_attr(onetone_option('page_title_bar_borders_color', ''));  
  80. $top_bar_social_icons_color = esc_attr(onetone_option('top_bar_social_icons_color'));  
  81.  
  82.  
  83. // top bar icon color 
  84. if($sticky_header_background_color) { 
  85. $onetone_custom_css .= ".top-bar-sns li i{ 
  86. color: ".$top_bar_social_icons_color."; 
  87. }"; 
  88.  
  89. // sticky header background 
  90. if($sticky_header_background_color) { 
  91. $rgb = onetone_hex2rgb( $sticky_header_background_color ); 
  92. $onetone_custom_css .= ".fxd-header { 
  93. background-color: rgba(".$rgb[0].", ".$rgb[1].", ".$rgb[2].", ".$sticky_header_background_opacity."); 
  94. }"; 
  95.  
  96. // main header background 
  97. if( $header_background_color ) { 
  98. $rgb = onetone_hex2rgb( $header_background_color ); 
  99.  
  100. $onetone_custom_css .= ".main-header { 
  101. background-color: rgba(".$rgb[0].", ".$rgb[1].", ".$rgb[2].", ".$header_background_opacity."); 
  102. }"; 
  103.  
  104.  
  105. // sticky header 
  106.  
  107. $sticky_header_opacity = onetone_option('sticky_header_background_opacity', '1'); 
  108. $sticky_header_menu_item_padding = onetone_option('sticky_header_menu_item_padding', ''); 
  109. $sticky_header_navigation_font_size = onetone_option('sticky_header_navigation_font_size', ''); 
  110. $sticky_header_logo_width = onetone_option('sticky_header_logo_width', ''); 
  111. $logo_left_margin = onetone_option('logo_left_margin', ''); 
  112. $logo_right_margin = onetone_option('logo_right_margin', ''); 
  113. $logo_top_margin = onetone_option('logo_top_margin', ''); 
  114. $logo_bottom_margin = onetone_option('logo_bottom_margin', ''); 
  115.  
  116. if( $sticky_header_background_color ) { 
  117. $rgb = onetone_hex2rgb( $sticky_header_background_color ); 
  118. $onetone_custom_css .= ".fxd-header{background-color: rgba(".$rgb[0].", ".$rgb[1].", ".$rgb[2].", ".esc_attr($sticky_header_opacity).");}\r\n"; 
  119.  
  120. if( $sticky_header_menu_item_padding ) 
  121. $onetone_custom_css .= ".fxd-header .site-nav > ul > li > a {padding:".absint($sticky_header_menu_item_padding)."px;}\r\n"; 
  122.  
  123. if( $sticky_header_navigation_font_size ) 
  124. $onetone_custom_css .= ".fxd-header .site-nav > ul > li > a {font-size:".absint($sticky_header_navigation_font_size)."px;}\r\n"; 
  125.  
  126. if( $sticky_header_logo_width ) 
  127. $onetone_custom_css .= ".fxd-header img.site-logo{ width:".absint($sticky_header_logo_width)."px;}\r\n"; 
  128.  
  129. if( $logo_left_margin ) 
  130. $onetone_custom_css .= "img.site-logo{ margin-left:".absint($logo_left_margin)."px;}\r\n"; 
  131.  
  132. if( $logo_right_margin ) 
  133. $onetone_custom_css .= "img.site-logo{ margin-right:".absint($logo_right_margin)."px;}\r\n"; 
  134.  
  135. if( $logo_top_margin ) 
  136. $onetone_custom_css .= "img.site-logo{ margin-top:".absint($logo_top_margin)."px;}\r\n"; 
  137.  
  138. if( $logo_bottom_margin ) 
  139. $onetone_custom_css .= "img.site-logo{ margin-bottom:".absint($logo_bottom_margin)."px;}\r\n"; 
  140.  
  141. // top bar 
  142. $display_top_bar = onetone_option('display_top_bar', 'yes'); 
  143. $top_bar_background_color = onetone_option('top_bar_background_color', ''); 
  144. $top_bar_info_color = onetone_option('top_bar_info_color', ''); 
  145. $top_bar_menu_color = onetone_option('top_bar_menu_color', ''); 
  146.  
  147. if( $top_bar_background_color ) 
  148. $onetone_custom_css .= ".top-bar{background-color:".$top_bar_background_color.";}"; 
  149.  
  150. if( $display_top_bar == 'yes' ) 
  151. $onetone_custom_css .= ".top-bar{display:block;}"; 
  152.  
  153. if( $top_bar_info_color ) 
  154. $onetone_custom_css .= ".top-bar-info{color:".$top_bar_info_color.";}"; 
  155.  
  156. if( $top_bar_menu_color ) 
  157. $onetone_custom_css .= ".top-bar ul li a{color:".$top_bar_menu_color.";}"; 
  158.  
  159. // Header background 
  160. $header_background_image = onetone_option('header_background_image', ''); 
  161. $header_background_full = onetone_option('header_background_full', ''); 
  162. $header_background_repeat = onetone_option('header_background_repeat', ''); 
  163. $header_background_parallax = onetone_option('header_background_parallax', ''); 
  164. $header_background = ''; 
  165.  
  166. if( $header_background_image ) { 
  167. $header_background .= "header .main-header{\r\n"; 
  168.  
  169. $header_background .= "background-image: url(".esc_url($header_background_image).");\r\n"; 
  170.  
  171. if( $header_background_full == 'yes' ) 
  172. $header_background .= "-webkit-background-size: cover; 
  173. -moz-background-size: cover; 
  174. -o-background-size: cover; 
  175. background-size: cover;\r\n"; 
  176.  
  177. if( $header_background_parallax == 'no' )  
  178. $header_background .= "background-repeat:".$header_background_repeat.";"; 
  179.  
  180. if( $header_background_parallax == 'yes' ) 
  181. $header_background .= "background-attachment: fixed; 
  182. background-position:top center; 
  183. background-repeat: no-repeat;"; 
  184. $header_background .= "}\r\n";  
  185.  
  186. $onetone_custom_css .= $header_background; 
  187.  
  188. // Header Padding 
  189. $header_top_padding = onetone_option('header_top_padding', ''); 
  190. $header_bottom_padding = onetone_option('header_bottom_padding', ''); 
  191.  
  192. if( $header_top_padding ) 
  193. $onetone_custom_css .= ".site-nav > ul > li > a{padding-top:".$header_top_padding."}"; 
  194.  
  195. if( $header_bottom_padding ) 
  196. $onetone_custom_css .= ".site-nav > ul > li > a{padding-bottom:".$header_bottom_padding."}"; 
  197.  
  198. $content_background_color = esc_attr(onetone_option('content_background_color', '')); 
  199. $sidebar_background_color = esc_attr(onetone_option('sidebar_background_color', '')); 
  200. $footer_background_color = esc_attr(onetone_option('footer_background_color', '')); 
  201. $copyright_background_color = esc_attr(onetone_option('copyright_background_color', '')); 
  202.  
  203. // content backgroud color 
  204.  
  205. if( $content_background_color ) 
  206. $onetone_custom_css .= ".col-main {background-color:".$content_background_color.";}"; 
  207.  
  208. if( $sidebar_background_color ) 
  209. $onetone_custom_css .= ".col-aside-left, .col-aside-right {background-color:".$sidebar_background_color.";}"; 
  210.  
  211. //footer background 
  212. if( $footer_background_color ) 
  213. $onetone_custom_css .= "footer .footer-widget-area{background-color:".$footer_background_color.";}"; 
  214.  
  215. if( $copyright_background_color ) 
  216. $onetone_custom_css .= "footer .footer-info-area{background-color:".$copyright_background_color."}"; 
  217.  
  218. // Element Colors 
  219.  
  220. $form_background_color = esc_attr(onetone_option('form_background_color', '')); 
  221. $form_text_color = esc_attr(onetone_option('form_text_color', '')); 
  222. $form_border_color = esc_attr(onetone_option('form_border_color', '')); 
  223.  
  224. if( $form_background_color ) 
  225. $onetone_custom_css .= "footer input, footer textarea{background-color:".$form_background_color.";}"; 
  226.  
  227. if( $form_text_color ) 
  228. $onetone_custom_css .= "footer input, footer textarea{color:".$form_text_color.";}"; 
  229.  
  230. if( $form_border_color ) 
  231. $onetone_custom_css .= "footer input, footer textarea{border-color:".$form_border_color.";}"; 
  232.  
  233. //Layout Options 
  234.  
  235. $page_content_top_padding = esc_attr(onetone_option('page_content_top_padding', '')); 
  236. $page_content_bottom_padding = esc_attr(onetone_option('page_content_bottom_padding', '')); 
  237. $hundredp_padding = esc_attr(onetone_option('hundredp_padding', '')); 
  238. $sidebar_padding = esc_attr(onetone_option('sidebar_padding', '')); 
  239. $column_top_margin = esc_attr(onetone_option('column_top_margin', '')); 
  240. $column_bottom_margin = esc_attr(onetone_option('column_bottom_margin', '')); 
  241.  
  242. if( $page_content_top_padding ) 
  243. $onetone_custom_css .= ".post-inner, .page-inner{padding-top:".$page_content_top_padding.";}"; 
  244.  
  245. if( $page_content_bottom_padding ) 
  246. $onetone_custom_css .= ".post-inner, .page-inner{padding-bottom:".$page_content_bottom_padding.";}"; 
  247.  
  248. if( isset($page_meta['padding_top']) && $page_meta['padding_top'] !='' ) 
  249. $onetone_custom_css .= ".post-inner, .page-inner{padding-top:".esc_attr($page_meta['padding_top']).";}"; 
  250.  
  251. if( isset($page_meta['padding_bottom']) && $page_meta['padding_bottom'] !='' ) 
  252. $onetone_custom_css .= ".post-inner, .page-inner{padding-bottom:".esc_attr($page_meta['padding_bottom']).";}"; 
  253.  
  254. if( $sidebar_padding ) 
  255. $onetone_custom_css .= ".col-aside-left, .col-aside-right{padding:".$sidebar_padding.";}"; 
  256.  
  257. if( $column_top_margin ) 
  258. $onetone_custom_css .= ".col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9{margin-top:".$column_top_margin.";}"; 
  259.  
  260. if( $column_bottom_margin ) 
  261. $onetone_custom_css .= ".col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9{margin-bottom:".$column_bottom_margin.";}"; 
  262.  
  263. //fonts color 
  264.  
  265. $fixed_header_text_color = esc_attr(onetone_option('fixed_header_text_color')); 
  266. $overlay_header_text_color = esc_attr(onetone_option('overlay_header_text_color')); 
  267. $page_title_color = esc_attr(onetone_option('page_title_color', '')); 
  268. $h1_color = esc_attr(onetone_option('h1_color', '')); 
  269. $h2_color = esc_attr(onetone_option('h2_color', '')); 
  270. $h3_color = esc_attr(onetone_option('h3_color', '')); 
  271. $h4_color = esc_attr(onetone_option('h4_color', '')); 
  272. $h5_color = esc_attr(onetone_option('h5_color', '')); 
  273. $h6_color = esc_attr(onetone_option('h6_color', '')); 
  274. $body_text_color = esc_attr(onetone_option('body_text_color', '')); 
  275. $link_color = esc_attr(onetone_option('link_color', '')); 
  276. $breadcrumbs_text_color = esc_attr(onetone_option('breadcrumbs_text_color', '')); 
  277. $sidebar_widget_headings_color = esc_attr(onetone_option('sidebar_widget_headings_color', '')); 
  278. $footer_headings_color = esc_attr(onetone_option('footer_headings_color', '')); 
  279. $footer_text_color = esc_attr(onetone_option('footer_text_color')); 
  280. $footer_link_color = esc_attr(onetone_option('footer_link_color')); 
  281.  
  282. if( $fixed_header_text_color ) 
  283. $onetone_custom_css .= ".fxd-header .site-tagline, .fxd-header .site-name{color:".$fixed_header_text_color.";}"; 
  284.  
  285. if( $overlay_header_text_color ) 
  286. $onetone_custom_css .= "header.overlay .main-header .site-tagline, header.overlay .main-header .site-name{color:".$overlay_header_text_color.";}"; 
  287.  
  288. if( $page_title_color ) 
  289. $onetone_custom_css .= ".page-title h1{color:".$page_title_color.";}"; 
  290. if( $h1_color ) 
  291. $onetone_custom_css .= "h1{color:".$h1_color.";}"; 
  292. if( $h2_color ) 
  293. $onetone_custom_css .= "h2{color:".$h2_color.";}"; 
  294. if( $h3_color ) 
  295. $onetone_custom_css .= "h3{color:".$h3_color.";}"; 
  296. if( $h4_color ) 
  297. $onetone_custom_css .= "h4{color:".$h4_color.";}"; 
  298. if( $h5_color ) 
  299. $onetone_custom_css .= "h5{color:".$h5_color.";}"; 
  300. if( $h6_color ) 
  301. $onetone_custom_css .= "h6{color:".$h6_color.";}"; 
  302.  
  303. if( $body_text_color ) 
  304. $onetone_custom_css .= ".entry-content, .entry-content p{color:".$body_text_color.";}"; 
  305.  
  306. if( $link_color ) 
  307. $onetone_custom_css .= ".entry-summary a, .entry-content a{color:".$link_color.";}"; 
  308.  
  309. if( $breadcrumbs_text_color ) 
  310. $onetone_custom_css .= ".breadcrumb-nav span, .breadcrumb-nav a{color:".$breadcrumbs_text_color.";}"; 
  311.  
  312. if( $sidebar_widget_headings_color ) 
  313. $onetone_custom_css .= ".col-aside-left .widget-title, .col-aside-right .widget-title{color:".$sidebar_widget_headings_color.";}"; 
  314.  
  315. if( $footer_headings_color ) 
  316. $onetone_custom_css .= ".footer-widget-area .widget-title{color:".$footer_headings_color.";}"; 
  317.  
  318. if( $footer_text_color ) 
  319. $onetone_custom_css .= "footer, footer p, footer span, footer div{color:".$footer_text_color.";}"; 
  320.  
  321. if( $footer_link_color ) 
  322. $onetone_custom_css .= "footer a{color:".$footer_link_color.";}"; 
  323.  
  324. //Main Menu Colors  
  325. $main_menu_background_color_1 = esc_attr(onetone_option('main_menu_background_color_1', '')); 
  326. $main_menu_font_color_1 = esc_attr(onetone_option('main_menu_font_color_1', '')); 
  327. $main_menu_overlay_font_color_1 = esc_attr(onetone_option('main_menu_overlay_font_color_1', '')); 
  328. $main_menu_font_hover_color_1 = esc_attr(onetone_option('main_menu_font_hover_color_1', '')); 
  329. $main_menu_background_color_2 = esc_attr(onetone_option('main_menu_background_color_2', '')); 
  330. $main_menu_font_color_2 = esc_attr(onetone_option('main_menu_font_color_2', '')); 
  331. $main_menu_font_hover_color_2 = esc_attr(onetone_option('main_menu_font_hover_color_2', '')); 
  332. $main_menu_separator_color_2 = esc_attr(onetone_option('main_menu_separator_color_2', '')); 
  333. $woo_cart_menu_background_color = esc_attr(onetone_option('woo_cart_menu_background_color', '')); 
  334. $side_menu_color = esc_attr(onetone_option('side_menu_color')); 
  335.  
  336. if( $main_menu_background_color_1 ) 
  337. $onetone_custom_css .= ".main-header .site-nav{ background-color:".$main_menu_background_color_1.";}"; 
  338.  
  339. if( $main_menu_font_color_1 ) 
  340. $onetone_custom_css .= "#menu-main > li > a {color:".$main_menu_font_color_1.";}"; 
  341.  
  342. if( $main_menu_overlay_font_color_1 ) 
  343. $onetone_custom_css .= "header.overlay .main-header #menu-main > li > a {color:".$main_menu_overlay_font_color_1.";}"; 
  344.  
  345. if( $main_menu_font_hover_color_1 ) 
  346. $onetone_custom_css .= "#menu-main > li > a:hover, #menu-main > li.current > a{color:".$main_menu_font_hover_color_1.";}"; 
  347.  
  348. if( $main_menu_background_color_2 ) 
  349. $onetone_custom_css .= ".main-header .sub-menu{background-color:".$main_menu_background_color_2.";}"; 
  350. $onetone_custom_css .= ".fxd-header .sub-menu{background-color:".$main_menu_background_color_2.";}"; 
  351. if( $main_menu_font_color_2 ) 
  352. $onetone_custom_css .= "#menu-main li li a{color:".$main_menu_font_color_2.";}"; 
  353. if( $main_menu_font_hover_color_2 ) 
  354. $onetone_custom_css .= "#menu-main li li a:hover{color:".$main_menu_font_hover_color_2.";}"; 
  355. if( $main_menu_separator_color_2 ) 
  356. $onetone_custom_css .= ".site-nav ul li li a{border-color:".$main_menu_separator_color_2." !important;}"; 
  357.  
  358. if( $side_menu_color ) 
  359. $onetone_custom_css .= " 
  360. @media screen and (min-width: 920px) { 
  361. .onetone-dots li a { 
  362. border: 2px solid ".$side_menu_color."; 
  363. .onetone-dots li.active a,  
  364. .onetone-dots li.current a,  
  365. .onetone-dots li a:hover { 
  366. background-color: ".$side_menu_color."; 
  367. }"; 
  368.  
  369. $onetone_custom_css .= "@media screen and (max-width: 920px) {\r\n 
  370. .site-nav ul{ background-color:".$main_menu_background_color_2.";}\r\n 
  371. #menu-main li a, header.overlay .main-header #menu-main > li > a {color:".$main_menu_font_color_2.";}\r\n 
  372. .site-nav ul li a{border-color:".$main_menu_separator_color_2." !important;}\r\n 
  373. }"; 
  374.  
  375.  
  376.  
  377.  
  378. // home page sections  
  379.  
  380. $section_title_css = ''; 
  381. $section_content_css = ''; 
  382. $video_background_section = onetone_option( 'video_background_section' ); 
  383.  
  384. for($i=0;$i<15;$i++): 
  385.  
  386. $section_css = ''; 
  387.  
  388. $section_background = onetone_option( 'section_background_'.$i ); 
  389. $background_size = onetone_option( 'background_size_'.$i ); 
  390. $section_padding = onetone_option( 'section_padding_'.$i , $i == 0?'':'50px 0'); 
  391. $text_align = onetone_option( 'text_align_'.$i); 
  392. $parallax_scrolling = onetone_option( 'parallax_scrolling_'.$i ); 
  393.  
  394. $section_title_typography = onetone_option( 'section_title_typography_'.$i); 
  395. $title_typography = onetone_get_typography( $section_title_typography ); 
  396.  
  397. $section_subtitle_typography = onetone_option( 'section_subtitle_typography_'.$i); 
  398. $subtitle_typography = onetone_get_typography( $section_subtitle_typography ); 
  399.  
  400. $section_content_typography = onetone_option( 'section_content_typography_'.$i); 
  401. $content_typography = onetone_get_typography( $section_content_typography ); 
  402. $content_nosize_typography = onetone_get_typography($section_content_typography, array('face', 'style', 'color')); 
  403. $content_color_typography = onetone_get_typography($section_content_typography, array('color')); 
  404.  
  405. $section_title_color = isset( $section_title_typography['color'] )? $section_title_typography['color']:''; 
  406. $section_title_font = isset( $section_title_typography['face'] ) ? $section_title_typography['face']:''; 
  407. $section_content_color = isset( $section_content_typography['color'] )? $section_content_typography['color']:''; 
  408.  
  409.  
  410. if( $parallax_scrolling == "yes" || $parallax_scrolling == "1" || $parallax_scrolling == "on" ) { 
  411. $section_css .= "background-attachment:fixed;background-position:50% 0;background-repeat:repeat;\r\n"; 
  412.  
  413. if( $background_size == "yes" ) { 
  414. $section_css .= "-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;\r\n"; 
  415.  
  416. if( $section_padding ) { 
  417. $section_css .= "padding:".$section_padding.";\r\n";;  
  418.  
  419. //if( $video_background_section != ($i+1) || $detect->isMobile() || $detect->isTablet() ) 
  420. $section_css .= onetone_get_background( $section_background ); 
  421.  
  422. $section_title_css .= "section.home-section-".($i+1)." .section-title{text-align:center ;}\r\n"; 
  423.  
  424. if( $title_typography ) 
  425. $section_title_css .= "section.home-section-".($i+1)." .section-title{".$title_typography."}\r\n"; 
  426.  
  427. if( $section_title_color && $i==0 ) 
  428. $section_title_css .= "section.home-section-1 .section-title {border-color:".$section_title_color.";}\r\n"; 
  429.  
  430. if( $section_title_font =='' && $i==0 ) 
  431. $section_title_css .= "section.home-section-1 .section-title-container {font-family:'Lustria, serif';}\r\n";  
  432.  
  433. if( $subtitle_typography ) 
  434. $section_title_css .= "section.home-section-".($i+1)." .section-subtitle{".$subtitle_typography."}\r\n"; 
  435.  
  436. if( $content_typography ) 
  437. $section_content_css .= "section.home-section-".($i+1)." .home-section-content{".$content_typography."}\r\n"; 
  438.  
  439. if( $content_nosize_typography) 
  440. $section_title_css .= " 
  441. section.home-section-".($i+1)." .home-section-content p,  
  442. section.home-section-".($i+1)." .home-section-content h1,  
  443. section.home-section-".($i+1)." .home-section-content h2,  
  444. section.home-section-".($i+1)." .home-section-content h3,  
  445. section.home-section-".($i+1)." .home-section-content h4,  
  446. section.home-section-".($i+1)." .home-section-content h5,  
  447. section.home-section-".($i+1)." .home-section-content h6{".$content_nosize_typography."}\r\n";  
  448.  
  449.  
  450. if( $section_content_color && $i==0 ) 
  451. $section_content_css .= "section.home-section-1 .magee-btn-normal.btn-line.btn-light { 
  452. color: ".$section_content_color." !important; 
  453. border-color: ".$section_content_color." !important; 
  454. section.home-section-1 .banner-sns li a i { 
  455. color: ".$section_content_color."; 
  456. }\r\n"; 
  457.  
  458. if($section_content_color && $i==2 ) 
  459. $section_content_css .= "section.home-section-3 .home-section-content a { 
  460. color: ".$section_content_color." ; 
  461. }\r\n";  
  462.  
  463. if($section_content_color && $i==4 ) 
  464. $section_content_css .= "section.home-section-5 .home-section-content a { 
  465. color: ".$section_content_color." ; 
  466. }\r\n";  
  467.  
  468. if($section_content_color && $i==5 ) 
  469. $section_content_css .= "section.home-section-6 .home-section-content a { 
  470. color: ".$section_content_color." ; 
  471. }\r\n";  
  472.  
  473. if($section_content_color && $i==8 ) 
  474. $section_content_css .= "section.home-section-9 .home-section-content .form-control,  
  475. section.home-section-9 .home-section-content .magee-contact-form .magee-btn-normal, section.home-section-9 .contact-form input,  
  476. section.home-section-9 .contact-form textarea{ 
  477. color: ".$section_content_color." ; 
  478. border-color: ".$section_content_color." ; 
  479. }\r\n";  
  480.  
  481. if( $i==0) 
  482. $section_title_css .= "section.home-section-".($i+1)." .magee-heading{".$title_typography."}\r\n"; 
  483.  
  484.  
  485.  
  486. if( $text_align ) 
  487. $section_content_css .= "section.home-section-".($i+1)." .home-section-content{text-align:".$text_align."}\r\n"; 
  488.  
  489. $section_content_css .= "section.home-section-".($i+1)." {".$section_css."}\r\n";  
  490.  
  491. endfor; 
  492.  
  493. // footer 
  494.  
  495. $footer_background_image = onetone_option('footer_background_image', '');  
  496. $footer_bg_full = onetone_option('footer_bg_full', 'yes');  
  497. $footer_background_repeat = onetone_option('footer_background_repeat', '');  
  498. $footer_background_position = onetone_option('footer_background_position', '');  
  499. $footer_top_padding = onetone_option('footer_top_padding', '');  
  500. $footer_bottom_padding = onetone_option('footer_bottom_padding', '');  
  501.  
  502. $copyright_top_padding = onetone_option('copyright_top_padding');  
  503. $copyright_bottom_padding = onetone_option('copyright_bottom_padding');  
  504.  
  505. $footer_background = ""; 
  506.  
  507. if( $footer_background_image ) { 
  508. $footer_background .= ".footer-widget-area{\r\n"; 
  509.  
  510. $footer_background .= "background-image: url(".esc_url($footer_background_image).");\r\n"; 
  511.  
  512. if( $footer_bg_full == 'yes' ) 
  513. $footer_background .= "-webkit-background-size: cover; 
  514. -moz-background-size: cover; 
  515. -o-background-size: cover; 
  516. background-size: cover;\r\n"; 
  517.  
  518. $footer_background .= "background-repeat:".esc_attr($footer_background_repeat).";"; 
  519. $footer_background .= "background-position:".esc_attr($footer_background_position).";"; 
  520.  
  521.  
  522. $footer_background .= "}\r\n";  
  523.  
  524. $onetone_custom_css .= $footer_background ; 
  525.  
  526. $onetone_custom_css .= ".footer-widget-area{\r\n 
  527. padding-top:".$footer_top_padding.";\r\n 
  528. padding-bottom:".$footer_bottom_padding.";\r\n 
  529. }" ; 
  530. $onetone_custom_css .= ".footer-info-area{\r\n 
  531. padding-top:".$copyright_top_padding.";\r\n 
  532. padding-bottom:".$copyright_bottom_padding.";\r\n 
  533. }" ;  
  534.  
  535. $onetone_custom_css .= $section_title_css; 
  536. $onetone_custom_css .= $section_content_css; 
  537.  
  538. $onetone_custom_css .= $custom_css; 
  539.  
  540. wp_add_inline_style( 'onetone-main', $onetone_custom_css ); 
  541.  
  542. wp_enqueue_style( 'jquery.mb.YTPlayer', get_template_directory_uri().'/plugins/YTPlayer/css/jquery.mb.YTPlayer.min.css', '', '', true ); 
  543. wp_enqueue_script( 'jquery.mb.YTPlayer', get_template_directory_uri().'/plugins/YTPlayer/jquery.mb.YTPlayer.js', array( 'jquery' ), '', true ); 
  544. wp_enqueue_script( 'bootstrap', get_template_directory_uri().'/plugins/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '3.3.4', false ); 
  545. wp_enqueue_script( 'jquery.nav', get_template_directory_uri().'/plugins/jquery.nav.js', array( 'jquery' ), '1.4.14 ', false ); 
  546. wp_enqueue_script( 'jquery.scrollTo', get_template_directory_uri().'/plugins/jquery.scrollTo.js', array( 'jquery' ), '1.4.14', false ); 
  547. wp_enqueue_script( 'jquery.parallax', get_template_directory_uri().'/plugins/jquery.parallax-1.1.3.js', array( 'jquery' ), '1.1.3', true ); 
  548. wp_enqueue_script( 'respond', get_template_directory_uri().'/plugins/respond.min.js', array( 'jquery' ), '', true ); 
  549. wp_enqueue_script( 'less', get_template_directory_uri().'/plugins/less.min.js', array( 'jquery' ), '2.5.1', true ); 
  550. wp_enqueue_script( 'jquery.prettyPhoto', get_template_directory_uri().'/plugins/jquery.prettyPhoto.js', array( 'jquery' ), '3.1.5', true ); 
  551. wp_enqueue_script('masonry'); 
  552. wp_enqueue_script( 'jquery.counterup', get_template_directory_uri() . '/plugins/jquery.counterup.js', array( 'jquery'), '1.0', true ); 
  553. wp_enqueue_script( 'jquery.waypoints', get_template_directory_uri() . '/plugins/jquery.waypoints.js', array( 'jquery' ), null, true ); 
  554. wp_enqueue_script( 'owl.carousel', get_template_directory_uri() . '/plugins/owl-carousel/owl.carousel.js', array( 'jquery' ), '2.2.0', true ); 
  555.  
  556.  
  557. wp_enqueue_script( 'onetone-default', get_template_directory_uri().'/js/onetone.js', array( 'jquery' ), $theme_info->get( 'Version' ), true ); 
  558.  
  559. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {wp_enqueue_script( 'comment-reply' );} 
  560.  
  561. $slide_autoplay = onetone_option("slide_autoplay", 1); 
  562. $slide_time = onetone_option("slide_time"); 
  563. $slider_control = onetone_option("slider_control", 1); 
  564. $slider_pagination = onetone_option("slider_pagination", 1); 
  565. $slide_fullheight = onetone_option("slide_fullheight"); 
  566.  
  567. $slide_time = is_numeric($slide_time)?$slide_time:"5000"; 
  568.  
  569. $isMobile = 0; 
  570. if( $detect->isMobile() && !$detect->isTablet() ) { 
  571. $isMobile = 1; 
  572.  
  573. $sticky_header = esc_attr(onetone_option('enable_sticky_header', 'yes'));  
  574.  
  575. wp_localize_script( 'onetone-default', 'onetone_params', array( 
  576. 'ajaxurl' => admin_url('admin-ajax.php'),  
  577. 'themeurl' => get_template_directory_uri(),  
  578. 'slide_autoplay' => $slide_autoplay,  
  579. 'slideSpeed' => $slide_time,  
  580. 'slider_control' => $slider_control,  
  581. 'slider_pagination' => $slider_pagination,  
  582. 'slide_fullheight' => $slide_fullheight,  
  583. 'sticky_header' => $sticky_header,  
  584. 'isMobile' =>$isMobile,  
  585. 'primary_color' => $primary_color,  
  586. 'is_rtl' => $is_rtl,  
  587.  
  588. ) );