function onetone_custom_scripts() { global $page_meta, $post, $active_magee_shortcodes; if ($post) { $page_meta = get_post_meta($post->ID, '_onetone_post_meta'); } if (isset($page_meta[0]) && $page_meta[0] != '') { $page_meta = @json_decode($page_meta[0], true); } $theme_info = wp_get_theme(); $detect = new Mobile_Detect(); wp_enqueue_style('onetone-Yanone-Kaffeesatz', esc_url('//fonts.googleapis.com/css?family=Open+Sans:300,400,700|Yanone+Kaffeesatz|Lustria'), false, '', false); wp_enqueue_style('font-awesome', get_template_directory_uri() . '/plugins/font-awesome/css/font-awesome.min.css', false, '4.3.0', false); wp_enqueue_style('bootstrap', get_template_directory_uri() . '/plugins/bootstrap/css/bootstrap.min.css', false, '3.3.4', false); wp_enqueue_style('owl.carousel', get_template_directory_uri() . '/plugins/owl-carousel/assets/owl.carousel.css', false, '', false); wp_enqueue_style('prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css', false, '3.1.5', false); if (!onetone_is_plugin_active('magee-shortcodes/Magee.php')) { wp_enqueue_style('onetone-shortcodes', get_template_directory_uri() . '/css/shortcode.css', false, $theme_info->get('Version'), false); } wp_enqueue_style('onetone-main', get_stylesheet_uri(), array(), $theme_info->get('Version')); wp_enqueue_style('onetone-onetone', get_template_directory_uri() . '/css/onetone.css', false, $theme_info->get('Version'), false); wp_enqueue_style('onetone-ms', get_template_directory_uri() . '/css/onetone-ms.css', false, $theme_info->get('Version'), false); wp_enqueue_style('onetone-scheme', get_template_directory_uri() . '/css/scheme.less', false, $theme_info->get('Version'), false); wp_enqueue_style('onetone-home', get_template_directory_uri() . '/css/home.css', false, $theme_info->get('Version'), false); if (is_rtl()) { wp_enqueue_style('onetone-rtl', get_template_directory_uri() . '/rtl.css', false, $theme_info->get('Version'), false); } $background_array = onetone_option("page_background"); $background = onetone_get_background($background_array); $header_image = get_header_image(); $onetone_custom_css = ""; if (isset($header_image) && !empty($header_image)) { $onetone_custom_css .= ".home-header{background:url(" . $header_image . ") repeat;}\n"; } if ('blank' != get_header_textcolor() && '' != get_header_textcolor()) { $header_color = ' color:#' . get_header_textcolor() . ';'; $onetone_custom_css .= 'header .site-name,header .site-description,header .site-tagline{' . $header_color . '}'; } else { $onetone_custom_css .= 'header .site-name,header .site-description,header .site-tagline{display:none;}'; } $custom_css = onetone_option("custom_css"); $onetone_custom_css .= '.site{' . $background . '}'; $links_color = onetone_option('links_color', '#963'); //scheme $primary_color = esc_attr(onetone_option('primary_color', $links_color)); $links_color = onetone_option('links_color'); //if($links_color == "" || $links_color == null) //$links_color = "#963"; if ($links_color) { $onetone_custom_css .= '.entry-content a,.home-section-content a{color:' . $links_color . ';}'; } $top_menu_font_color = onetone_option('font_color'); if ($top_menu_font_color != "" && $top_menu_font_color != null) { $onetone_custom_css .= 'header .site-nav > ul > li > a {color:' . $top_menu_font_color . '}'; } // header $sticky_header_background_color = esc_attr(onetone_option('sticky_header_background_color', '')); $sticky_header_background_opacity = esc_attr(onetone_option('sticky_header_background_opacity', '1')); $header_background_color = esc_attr(onetone_option('header_background_color', '')); $header_background_opacity = esc_attr(onetone_option('header_background_opacity', '1')); $header_border_color = esc_attr(onetone_option('header_border_color', '')); $page_title_bar_background_color = esc_attr(onetone_option('page_title_bar_background_color', '')); $page_title_bar_borders_color = esc_attr(onetone_option('page_title_bar_borders_color', '')); // sticky header background if ($sticky_header_background_color) { $rgb = onetone_hex2rgb($sticky_header_background_color); $onetone_custom_css .= ".fxd-header {\r\n\t\tbackground-color: rgba(" . $rgb[0] . "," . $rgb[1] . "," . $rgb[2] . "," . $sticky_header_background_opacity . ");\r\n\t\t}"; } // main header background if ($header_background_color) { $rgb = onetone_hex2rgb($header_background_color); $onetone_custom_css .= ".main-header {\r\n\t\tbackground-color: rgba(" . $rgb[0] . "," . $rgb[1] . "," . $rgb[2] . "," . $header_background_opacity . ");\r\n\t\t}"; } // sticky header $sticky_header_opacity = onetone_option('sticky_header_background_opacity', '1'); $sticky_header_menu_item_padding = onetone_option('sticky_header_menu_item_padding', ''); $sticky_header_navigation_font_size = onetone_option('sticky_header_navigation_font_size', ''); $sticky_header_logo_width = onetone_option('sticky_header_logo_width', ''); $logo_left_margin = onetone_option('logo_left_margin', ''); $logo_right_margin = onetone_option('logo_right_margin', ''); $logo_top_margin = onetone_option('logo_top_margin', ''); $logo_bottom_margin = onetone_option('logo_bottom_margin', ''); if ($sticky_header_background_color) { $rgb = onetone_hex2rgb($sticky_header_background_color); $onetone_custom_css .= ".fxd-header{background-color: rgba(" . $rgb[0] . "," . $rgb[1] . "," . $rgb[2] . "," . esc_attr($sticky_header_opacity) . ");}\r\n"; } if ($sticky_header_menu_item_padding) { $onetone_custom_css .= ".fxd-header .site-nav > ul > li > a {padding:" . absint($sticky_header_menu_item_padding) . "px;}\r\n"; } if ($sticky_header_navigation_font_size) { $onetone_custom_css .= ".fxd-header .site-nav > ul > li > a {font-size:" . absint($sticky_header_navigation_font_size) . "px;}\r\n"; } if ($sticky_header_logo_width) { $onetone_custom_css .= ".fxd-header img.site-logo{ width:" . absint($sticky_header_logo_width) . "px;}\r\n"; } if ($logo_left_margin) { $onetone_custom_css .= ".fxd-header img.site-logo{ margin-left:" . absint($logo_left_margin) . "px;}\r\n"; } if ($logo_right_margin) { $onetone_custom_css .= ".fxd-header img.site-logo{ margin-right:" . absint($logo_right_margin) . "px;}\r\n"; } if ($logo_top_margin) { $onetone_custom_css .= ".fxd-header img.site-logo{ margin-top:" . absint($logo_top_margin) . "px;}\r\n"; } if ($logo_bottom_margin) { $onetone_custom_css .= ".fxd-header img.site-logo{ margin-bottom:" . absint($logo_bottom_margin) . "px;}\r\n"; } // top bar $display_top_bar = onetone_option('display_top_bar', 'yes'); $top_bar_background_color = onetone_option('top_bar_background_color', ''); $top_bar_info_color = onetone_option('top_bar_info_color', ''); $top_bar_menu_color = onetone_option('top_bar_menu_color', ''); if ($top_bar_background_color) { $onetone_custom_css .= ".top-bar{background-color:" . $top_bar_background_color . ";}"; } if ($display_top_bar == 'yes') { $onetone_custom_css .= ".top-bar{display:block;}"; } if ($top_bar_info_color) { $onetone_custom_css .= ".top-bar-info{color:" . $top_bar_info_color . ";}"; } if ($top_bar_menu_color) { $onetone_custom_css .= ".top-bar ul li a{color:" . $top_bar_menu_color . ";}"; } // Header background $header_background_image = onetone_option('header_background_image', ''); $header_background_full = onetone_option('header_background_full', ''); $header_background_repeat = onetone_option('header_background_repeat', ''); $header_background_parallax = onetone_option('header_background_parallax', ''); $header_background = ''; if ($header_background_image) { $header_background .= "header .main-header{\r\n"; $header_background .= "background-image: url(" . esc_url($header_background_image) . ");\r\n"; if ($header_background_full == 'yes') { $header_background .= "-webkit-background-size: cover;\r\n\t\t\t\t\t\t\t\t-moz-background-size: cover;\r\n\t\t\t\t\t\t\t\t-o-background-size: cover;\r\n\t\t\t\t\t\t\t\tbackground-size: cover;\r\n"; } if ($header_background_parallax == 'no') { $header_background .= "background-repeat:" . $header_background_repeat . ";"; } if ($header_background_parallax == 'yes') { $header_background .= "background-attachment: fixed;\r\n\t\t background-position:top center;\r\n\t\t\t\t\t\t\t background-repeat: no-repeat;"; } $header_background .= "}\r\n"; } $onetone_custom_css .= $header_background; // Header Padding $header_top_padding = onetone_option('header_top_padding', ''); $header_bottom_padding = onetone_option('header_bottom_padding', ''); if ($header_top_padding) { $onetone_custom_css .= ".site-nav > ul > li > a{padding-top:" . $header_top_padding . "}"; } if ($header_bottom_padding) { $onetone_custom_css .= ".site-nav > ul > li > a{padding-bottom:" . $header_bottom_padding . "}"; } //background $content_background_color = esc_attr(onetone_option('content_background_color', '')); $sidebar_background_color = esc_attr(onetone_option('sidebar_background_color', '')); $footer_background_color = esc_attr(onetone_option('footer_background_color', '')); $copyright_background_color = esc_attr(onetone_option('copyright_background_color', '')); // content backgroud color if ($content_background_color) { $onetone_custom_css .= ".col-main {background-color:" . $content_background_color . ";}"; } if ($sidebar_background_color) { $onetone_custom_css .= ".col-aside-left,.col-aside-right {background-color:" . $sidebar_background_color . ";}"; } //footer background if ($footer_background_color) { $onetone_custom_css .= "footer .footer-widget-area{background-color:" . $footer_background_color . ";}"; } if ($copyright_background_color) { $onetone_custom_css .= "footer .footer-info-area{background-color:" . $copyright_background_color . "}"; } // Element Colors $footer_widget_divider_color = esc_attr(onetone_option('footer_widget_divider_color', '')); $form_background_color = esc_attr(onetone_option('form_background_color', '')); $form_text_color = esc_attr(onetone_option('form_text_color', '')); $form_border_color = esc_attr(onetone_option('form_border_color', '')); if ($footer_widget_divider_color) { $onetone_custom_css .= ".footer-widget-area .widget-box li{\r\nborder-color:" . $footer_widget_divider_color . ";}"; } if ($form_background_color) { $onetone_custom_css .= "footer input,footer textarea{background-color:" . $form_background_color . ";}"; } if ($form_text_color) { $onetone_custom_css .= "footer input,footer textarea{color:" . $form_text_color . ";}"; } if ($form_border_color) { $onetone_custom_css .= "footer input,footer textarea{border-color:" . $form_border_color . ";}"; } //Layout Options $page_content_top_padding = esc_attr(onetone_option('page_content_top_padding', '')); $page_content_bottom_padding = esc_attr(onetone_option('page_content_bottom_padding', '')); $hundredp_padding = esc_attr(onetone_option('hundredp_padding', '')); $sidebar_padding = esc_attr(onetone_option('sidebar_padding', '')); $column_top_margin = esc_attr(onetone_option('column_top_margin', '')); $column_bottom_margin = esc_attr(onetone_option('column_bottom_margin', '')); if ($page_content_top_padding) { $onetone_custom_css .= ".post-inner,.page-inner{padding-top:" . $page_content_top_padding . ";}"; } if ($page_content_bottom_padding) { $onetone_custom_css .= ".post-inner,.page-inner{padding-bottom:" . $page_content_bottom_padding . ";}"; } if (isset($page_meta['padding_top']) && $page_meta['padding_top'] != '') { $onetone_custom_css .= ".post-inner,.page-inner{padding-top:" . esc_attr($page_meta['padding_top']) . ";}"; } if (isset($page_meta['padding_bottom']) && $page_meta['padding_bottom'] != '') { $onetone_custom_css .= ".post-inner,.page-inner{padding-bottom:" . esc_attr($page_meta['padding_bottom']) . ";}"; } if ($sidebar_padding) { $onetone_custom_css .= ".col-aside-left,.col-aside-right{padding:" . $sidebar_padding . ";}"; } if ($column_top_margin) { $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 . ";}"; } if ($column_bottom_margin) { $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 . ";}"; } //fonts color $header_tagline_color = esc_attr(onetone_option('header_tagline_color', '')); $page_title_color = esc_attr(onetone_option('page_title_color', '')); $h1_color = esc_attr(onetone_option('h1_color', '')); $h2_color = esc_attr(onetone_option('h2_color', '')); $h3_color = esc_attr(onetone_option('h3_color', '')); $h4_color = esc_attr(onetone_option('h4_color', '')); $h5_color = esc_attr(onetone_option('h5_color', '')); $h6_color = esc_attr(onetone_option('h6_color', '')); $body_text_color = esc_attr(onetone_option('body_text_color', '')); $link_color = esc_attr(onetone_option('link_color', '')); $breadcrumbs_text_color = esc_attr(onetone_option('breadcrumbs_text_color', '')); $sidebar_widget_headings_color = esc_attr(onetone_option('sidebar_widget_headings_color', '')); $footer_headings_color = esc_attr(onetone_option('footer_headings_color', '')); $footer_text_color = esc_attr(onetone_option('footer_text_color', '')); $footer_link_color = esc_attr(onetone_option('footer_link_color', '')); if ($header_tagline_color) { $onetone_custom_css .= ".site-tagline{color:" . $header_tagline_color . ";}"; } if ($page_title_color) { $onetone_custom_css .= ".page-title h1{color:" . $page_title_color . ";}"; } if ($h1_color) { $onetone_custom_css .= "h1{color:" . $h1_color . ";}"; } if ($h2_color) { $onetone_custom_css .= "h2{color:" . $h2_color . ";}"; } if ($h3_color) { $onetone_custom_css .= "h3{color:" . $h3_color . ";}"; } if ($h4_color) { $onetone_custom_css .= "h4{color:" . $h4_color . ";}"; } if ($h5_color) { $onetone_custom_css .= "h5{color:" . $h5_color . ";}"; } if ($h6_color) { $onetone_custom_css .= "h6{color:" . $h6_color . ";}"; } if ($body_text_color) { $onetone_custom_css .= ".entry-content,.entry-content p{color:" . $body_text_color . ";}"; } if ($link_color) { $onetone_custom_css .= ".entry-summary a, .entry-content a{color:" . $link_color . ";}"; } if ($breadcrumbs_text_color) { $onetone_custom_css .= ".breadcrumb-nav span,.breadcrumb-nav a{color:" . $breadcrumbs_text_color . ";}"; } if ($sidebar_widget_headings_color) { $onetone_custom_css .= ".col-aside-left .widget-title,.col-aside-right .widget-title{color:" . $sidebar_widget_headings_color . ";}"; } if ($footer_headings_color) { $onetone_custom_css .= ".footer-widget-area .widget-title{color:" . $footer_headings_color . ";}"; } if ($footer_text_color) { $onetone_custom_css .= ".footer-widget-area,.footer-widget-area p,.footer-widget-area span{color:" . $footer_text_color . ";}"; } if ($footer_link_color) { $onetone_custom_css .= ".footer-widget-area a{color:" . $footer_link_color . ";}"; } //Main Menu Colors $main_menu_background_color_1 = esc_attr(onetone_option('main_menu_background_color_1', '')); $main_menu_font_color_1 = esc_attr(onetone_option('main_menu_font_color_1', '')); $main_menu_font_hover_color_1 = esc_attr(onetone_option('main_menu_font_hover_color_1', '')); $main_menu_background_color_2 = esc_attr(onetone_option('main_menu_background_color_2', '')); $main_menu_font_color_2 = esc_attr(onetone_option('main_menu_font_color_2', '')); $main_menu_font_hover_color_2 = esc_attr(onetone_option('main_menu_font_hover_color_2', '')); $main_menu_separator_color_2 = esc_attr(onetone_option('main_menu_separator_color_2', '')); $woo_cart_menu_background_color = esc_attr(onetone_option('woo_cart_menu_background_color', '')); if ($main_menu_background_color_1) { $onetone_custom_css .= ".main-header{background-color:" . $main_menu_background_color_1 . ";}"; } if ($main_menu_font_color_1) { $onetone_custom_css .= "#menu-main > li > a {color:" . $main_menu_font_color_1 . ";}"; } if ($main_menu_font_hover_color_1) { $onetone_custom_css .= "#menu-main > li > a:hover{color:" . $main_menu_font_hover_color_1 . ";}"; } if ($main_menu_background_color_2) { $onetone_custom_css .= ".main-header .sub-menu{background-color:" . $main_menu_background_color_2 . ";}"; } if ($main_menu_font_color_2) { $onetone_custom_css .= "#menu-main li li a{color:" . $main_menu_font_color_2 . ";}"; } if ($main_menu_font_hover_color_2) { $onetone_custom_css .= "#menu-main li li a:hover{color:" . $main_menu_font_hover_color_2 . ";}"; } if ($main_menu_separator_color_2) { $onetone_custom_css .= ".site-nav ul li li a{border-color:" . $main_menu_separator_color_2 . " !important;}"; } // home page sections $section_title_css = ''; $section_content_css = ''; $video_background_section = onetone_option('video_background_section'); for ($i = 0; $i < 15; $i++) { $section_css = ''; $section_background = onetone_option('section_background_' . $i); $background_size = onetone_option('background_size_' . $i); $section_padding = onetone_option('section_padding_' . $i, $i == 0 ? '' : '50px 0'); $text_align = onetone_option('text_align_' . $i); $parallax_scrolling = onetone_option('parallax_scrolling_' . $i); $section_title_typography = onetone_option('section_title_typography_' . $i); $title_typography = onetone_get_typography($section_title_typography); $section_content_typography = onetone_option('section_content_typography_' . $i); $content_typography = onetone_get_typography($section_content_typography); if ($parallax_scrolling == "yes" || $parallax_scrolling == "1") { $section_css .= "background-attachment:fixed;background-position:50% 0;background-repeat:repeat;\r\n"; } if ($background_size == "yes") { $section_css .= "-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;\r\n"; } if ($section_padding) { $section_css .= "padding:" . $section_padding . ";\r\n"; } if ($video_background_section != $i + 1 || $detect->isMobile() || $detect->isTablet()) { $section_css .= onetone_get_background($section_background); } $section_title_css .= "section.home-section-" . ($i + 1) . " .section-title{text-align:center ;}\r\n"; if ($title_typography) { $section_title_css .= "section.home-section-" . ($i + 1) . " .section-title{" . $title_typography . "}\r\n"; } if ($content_typography) { $section_content_css .= "\r\n\tsection.home-section-" . ($i + 1) . " .home-section-content,\r\n\tsection.home-section-" . ($i + 1) . " p{" . $content_typography . "}\r\n"; } if ($i == 0) { $section_title_css .= "section.home-section-" . ($i + 1) . " .magee-heading{" . $title_typography . "}\r\n"; } if ($text_align) { $section_content_css .= "section.home-section-" . ($i + 1) . " .home-section-content{text-align:" . $text_align . "}\r\n"; } $section_content_css .= "section.home-section-" . ($i + 1) . " {" . $section_css . "}\r\n"; } // footer $footer_background_image = onetone_option('footer_background_image', ''); $footer_bg_full = onetone_option('footer_bg_full', 'yes'); $footer_background_repeat = onetone_option('footer_background_repeat', ''); $footer_background_position = onetone_option('footer_background_position', ''); $footer_top_padding = onetone_option('footer_top_padding', ''); $footer_bottom_padding = onetone_option('footer_bottom_padding', ''); $footer_background = ""; if ($footer_background_image) { $footer_background .= ".footer-widget-area{\r\n"; $footer_background .= "background-image: url(" . esc_url($footer_background_image) . ");\r\n"; if ($footer_bg_full == 'yes') { $footer_background .= "-webkit-background-size: cover;\r\n\t\t\t\t\t\t\t\t-moz-background-size: cover;\r\n\t\t\t\t\t\t\t\t-o-background-size: cover;\r\n\t\t\t\t\t\t\t\tbackground-size: cover;\r\n"; } $footer_background .= "background-repeat:" . esc_attr($footer_background_repeat) . ";"; $footer_background .= "background-position:" . esc_attr($footer_background_position) . ";"; $footer_background .= "}\r\n"; } $onetone_custom_css .= $footer_background; $onetone_custom_css .= $section_title_css; $onetone_custom_css .= $section_content_css; $onetone_custom_css .= $custom_css; wp_add_inline_style('onetone-main', $onetone_custom_css); wp_enqueue_style('onetone-bigvideo', get_template_directory_uri() . '/plugins/YTPlayer/css/jquery.mb.YTPlayer.min.css', '', '', true); wp_enqueue_script('onetone-bigvideo', get_template_directory_uri() . '/plugins/YTPlayer/jquery.mb.YTPlayer.js', array('jquery'), '', true); wp_enqueue_script('bootstrap', get_template_directory_uri() . '/plugins/bootstrap/js/bootstrap.min.js', array('jquery'), '3.3.4 ', false); wp_enqueue_script('onetone-nav', get_template_directory_uri() . '/plugins/jquery.nav.js', array('jquery'), '1.4.14 ', false); wp_enqueue_script('onetone-scrollTo', get_template_directory_uri() . '/plugins/jquery.scrollTo.js', array('jquery'), '1.4.14 ', false); wp_enqueue_script('onetone-carousel', get_template_directory_uri() . '/plugins/owl-carousel/owl.carousel.min.js', array('jquery'), '', true); wp_enqueue_script('onetone-parallax', get_template_directory_uri() . '/plugins/jquery.parallax-1.1.3.js', array('jquery'), '1.1.3', true); wp_enqueue_script('onetone-respond', get_template_directory_uri() . '/plugins/respond.min.js', array('jquery'), '', true); wp_enqueue_script('onetone-less', get_template_directory_uri() . '/plugins/less.min.js', array('jquery'), '2.5.1', true); wp_enqueue_script('prettyPhoto', get_template_directory_uri() . '/plugins/jquery.prettyPhoto.js', array('jquery'), '3.1.5', true); wp_enqueue_script('onetone-default', get_template_directory_uri() . '/js/onetone.js', array('jquery'), $theme_info->get('Version'), true); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } $slide_time = onetone_option("slide_time"); $slide_time = is_numeric($slide_time) ? $slide_time : "5000"; $isMobile = 0; if ($detect->isMobile() && !$detect->isTablet()) { $isMobile = 1; } $sticky_header = esc_attr(onetone_option('enable_sticky_header', 'yes')); wp_localize_script('onetone-default', 'onetone_params', array('ajaxurl' => admin_url('admin-ajax.php'), 'themeurl' => get_template_directory_uri(), 'slideSpeed' => $slide_time, 'sticky_header' => $sticky_header, 'isMobile' => $isMobile, 'primary_color' => $primary_color)); }
if ($section_1_content == 'slider' && $i == 0) { echo onetone_get_default_slider(); } else { $section_title = onetone_option('section_title_' . $i, isset($default_options[$i]['section_title']) ? $default_options[$i]['section_title'] : ''); $section_menu = onetone_option('menu_title_' . $i, isset($default_options[$i]['menu_title']) ? $default_options[$i]['menu_title'] : ''); $section_background = onetone_option('section_background_' . $i, isset($default_options[$i]['section_background']) ? $default_options[$i]['section_background'] : ''); $parallax_scrolling = onetone_option('parallax_scrolling_' . $i, isset($default_options[$i]['parallax_scrolling']) ? $default_options[$i]['parallax_scrolling'] : ''); $section_css_class = onetone_option('section_css_class_' . $i, isset($default_options[$i]['section_css_class']) ? $default_options[$i]['section_css_class'] : ''); $section_content = onetone_option('section_content_' . $i, isset($default_options[$i]['section_content']) ? $default_options[$i]['section_content'] : onetone_option('sction_content_' . $i)); $section_slug = onetone_option('menu_slug_' . $i, isset($default_options[$i]['menu_slug']) ? $default_options[$i]['menu_slug'] : ''); $section_padding = onetone_option('section_padding_' . $i, isset($default_options[$i]['section_padding']) ? $default_options[$i]['section_padding'] : '50px 0'); $text_align = onetone_option('text_align_' . $i, isset($default_options[$i]['text_align']) ? $default_options[$i]['text_align'] : ''); $section_title_typography = onetone_option('section_title_typography_' . $i, isset($default_options[$i]['section_title_typography']) ? $default_options[$i]['section_title_typography'] : ''); $title_typography = onetone_get_typography($section_title_typography); $section_content_typography = onetone_option('section_content_typography_' . $i, isset($default_options[$i]['section_content_typography']) ? $default_options[$i]['section_content_typography'] : ''); $content_typography = onetone_get_typography($section_content_typography); if ($section_slug) { $section_slug = sanitize_title($section_slug); } else { $section_slug = 'section-' . ($i + 1); } $section_css = ''; $background = onetone_get_background($section_background); $sanitize_title = $section_slug; $css_class = isset($section_css_class) ? $section_css_class : ""; $background_video = ''; $video_wrap = ''; $video_enable = 0; $detect = new Mobile_Detect(); if ($section_background_video != "" && $video_background_section == $i + 1 && !$detect->isMobile() && !$detect->isTablet()) { $video_enable = 1;
function onetone_custom_scripts() { wp_enqueue_style('Yanone-Kaffeesatz', esc_url('//fonts.googleapis.com/css?family=Yanone+Kaffeesatz|Lustria|Raleway|Open+Sans:400,300'), false, '', false); wp_enqueue_style('onetone-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', false, '4.0.3', false); wp_enqueue_style('onetone-shortcodes', get_template_directory_uri() . '/css/shortcodes.css', false, '1.3.0', false); wp_enqueue_style('onetone-prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css', false, '3.1.5', false); wp_enqueue_style('onetone-animation', get_template_directory_uri() . '/css/animation.css', false, '1.3.0', false); wp_enqueue_style('onetone-owl-carousel', get_template_directory_uri() . '/css/owl.carousel.css', false, '1.3.3', false); wp_enqueue_style('onetone-owl-theme', get_template_directory_uri() . '/css/owl.theme.css', false, '1.3.3', false); wp_enqueue_style('onetone-bigvideo', get_template_directory_uri() . '/css/bigvideo.css', false, '1.3.3', false); wp_enqueue_style('onetone-main', get_stylesheet_uri(), array(), '1.3.3'); $page_background = onetone_options_array("page_background"); $_page_background = onetone_get_background($page_background); $header_image = get_header_image(); $header_opacity = onetone_options_array("header_opacity", 1); $onetone_custom_css = ""; if (isset($header_image) && !empty($header_image)) { $onetone_custom_css .= ".home-header, .template-header{background-image:url(" . $header_image . ");background-attachment: fixed;background-repeat:no-repeat;background-size:cover;-moz-background-size:cover;-webkit-background-size:cover;opacity:" . $header_opacity . ";}\n"; } $onetone_custom_css .= ".home-header, .template-header{opacity:" . $header_opacity . ";}\n"; if ('blank' != get_header_textcolor() && '' != get_header_textcolor()) { $header_color = ' color:#' . get_header_textcolor() . ';'; $onetone_custom_css .= '.home-header, .template-header,.site-name,.site-description{' . $header_color . '}'; } $custom_css = onetone_options_array("custom_css"); $onetone_custom_css .= '.site{' . $_page_background . '}'; $top_menu_font_color = onetone_options_array('font_color'); if ($top_menu_font_color != "" && $top_menu_font_color != null) { $onetone_custom_css .= 'header #menu-main > li > a span,header .top-nav > ul > li > a span{color:' . $top_menu_font_color . '}'; } //typography $homepage_nav_typography = onetone_options_array('homepage_nav_typography'); $_homepage_nav_typography = onetone_get_typography($homepage_nav_typography); $onetone_custom_css .= '.home-navigation > ul > li > a > span{' . $_homepage_nav_typography . '}'; $section_title_typography = onetone_options_array('section_title_typography'); $_section_title_typography = onetone_get_typography($section_title_typography); $onetone_custom_css .= 'section h1.section-title{' . $_section_title_typography . '}'; $footer_typography = onetone_options_array('footer_typography'); $_footer_typography = onetone_get_typography($footer_typography); $onetone_custom_css .= 'footer .footer-copyright{' . $_footer_typography . '}'; // $footer_background = onetone_options_array("footer_background"); $_footer_background = onetone_get_background($footer_background); $onetone_custom_css .= 'footer.home-footer{' . $_footer_background . '}'; $onetone_custom_css .= $custom_css; wp_add_inline_style('onetone-main', $onetone_custom_css); if (is_home()) { wp_enqueue_script('onetone-bigvideo', get_template_directory_uri() . '/js/jquery.tubular.1.0.js', array('jquery'), '1.0', true); } wp_enqueue_script('onetone-modernizr', get_template_directory_uri() . '/js/modernizr.custom.js', array('jquery'), '2.8.2 ', false); wp_enqueue_script('onetone-carousel', get_template_directory_uri() . '/js/owl.carousel.js', array('jquery'), '1.3.3 ', true); wp_enqueue_script('onetone-prettyPhoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', array('jquery'), '3.1.5', true); wp_enqueue_script('onetone-nav', get_template_directory_uri() . '/js/jquery.nav.js', array('jquery'), '3.0.0', true); wp_enqueue_script('onetone-default', get_template_directory_uri() . '/js/onetone.js', array('jquery'), '1.3.0', true); $slide_time = onetone_options_array("slide_time"); $slide_time = is_numeric($slide_time) ? $slide_time : "5000"; if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_localize_script('onetone-default', 'onetone_params', array('ajaxurl' => admin_url('admin-ajax.php'), 'themeurl' => get_template_directory_uri(), 'slideSpeed' => $slide_time)); }