function ts_get_body_main_class($classes) { //add body class and main menu style selected from control panel $added_body_class = false; $added_main_menu_style = false; if (ts_check_if_control_panel()) { if (ts_check_if_use_control_panel_cookies() && !empty($_COOKIE['theme_body_class'])) { $added_body_class = true; $classes[] = $_COOKIE['theme_body_class']; } else { if (isset($_GET['switch_layout']) && !empty($_GET['switch_layout'])) { $added_body_class = true; $classes[] = $_GET['switch_layout']; } } if (ts_check_if_use_control_panel_cookies() && !empty($_COOKIE['theme_main_menu_style'])) { $main_menu_style = $_COOKIE['theme_main_menu_style']; } elseif (isset($_GET['switch_main_menu_style']) && !empty($_GET['switch_main_menu_style'])) { $main_menu_style = $_GET['switch_main_menu_style']; } if (!empty($main_menu_style)) { $added_main_menu_style = true; switch ($main_menu_style) { case 'style1': break; case 'style2': $classes[] = 'headerstyle2'; break; case 'style3': $classes[] = 'headerstyle3'; break; case 'style4': $classes[] = 'headerstyle4'; break; } } } //add body_class set in theme options only if not added from control panel if ($added_body_class == false) { $class = ot_get_option('body_class'); if (empty($class)) { $class = 'w1170'; } $classes[] = $class; } //add body_class set in theme options only if not added from control panel if ($added_main_menu_style == false) { $style = ts_get_main_menu_style(); if (!empty($style)) { switch ($style) { case 'style1': break; case 'style2': $classes[] = 'headerstyle2'; break; case 'style3': $classes[] = 'headerstyle3'; break; case 'style4': $classes[] = 'headerstyle4'; break; } } } //add class if there is not header image $slider = null; if (is_page()) { $slider = get_post_meta(get_the_ID(), 'post_slider', true); if ($slider) { $slider = ts_get_post_slider(get_the_ID()); } else { $slider = null; } if (empty($slider)) { $header_background = get_post_meta(get_the_ID(), 'header_background', true); if (empty($header_background)) { $classes[] = 'no-header-image'; } } } //add class if sticky menu is enabled if (ot_get_option('show_sticky_menu') != 'no') { $classes[] = 'sticky-menu-on'; } return $classes; }
/** * Display dynamic css styles, function is used when opening page and in control panel when we change colors * @param type $ajax_request */ function ts_the_theme_dynamic_styles($ajax_request = true) { $main_color = ot_get_option('main_color'); //change color if control panel is enabled if (ts_check_if_control_panel()) { if (isset($_GET['main_color']) && !empty($_GET['main_color'])) { setcookie('theme_main_color', $_GET['main_color'], null, '/'); $_COOKIE['theme_main_color'] = $_GET['main_color']; $main_color = $_COOKIE['theme_main_color']; } if (ts_check_if_use_control_panel_cookies() && isset($_COOKIE['theme_main_color']) && !empty($_COOKIE['theme_main_color'])) { $main_color = $_COOKIE['theme_main_color']; } } ?> <?php if (1 == 2) { //fake <style> tag, reguired only for editor formatting, please don't remove ?> <style> <?php } ?> <?php if (in_array(ot_get_option('body_class'), array('w1170', 'w960')) && ot_get_option('main_body_background_color')) { ?> body { background: <?php echo ot_get_option('main_body_background_color'); ?> } <?php } ?> <?php if (in_array(ot_get_option('body_class'), array('b1170', 'b960')) && ot_get_option('main_body_background_color')) { ?> .b1170 .page-header>.wrapper, .b960 .page-header>.wrapper, .b1170>div.wrapper, .b960>div.wrapper { background: <?php echo ot_get_option('main_body_background_color'); ?> } <?php } ?> <?php if ($main_color) { ?> /* main_color */ <?php ts_get_main_color_classes(); ?> { color: <?php echo $main_color; ?> ; } <?php ts_get_our_staff_shadow_color_classes(); ?> { -webkit-box-shadow: 0 3px 0 0 <?php echo $main_color; ?> ; box-shadow: 0 3px 0 0 <?php echo $main_color; ?> ; } <?php ts_get_main_color_background_classes(); ?> { background-color: <?php echo $main_color; ?> ; } <?php ts_get_main_color_background_gradient_classes(); ?> { background: -moz-radial-gradient(center, ellipse cover, <?php echo ts_change_color($main_color, 20, true, '0.94'); ?> 0%, <?php echo ts_hex_to_rgb($main_color, '0.85'); ?> 100%); background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,<?php echo ts_change_color($main_color, 20, true, '0.94'); ?> ), color-stop(100%,<?php echo ts_hex_to_rgb($main_color, '0.85'); ?> )); background: -webkit-radial-gradient(center, ellipse cover, <?php echo ts_change_color($main_color, 20, true, '0.94'); ?> 0%,<?php echo ts_hex_to_rgb($main_color, '0.85'); ?> 100%); background: -o-radial-gradient(center, ellipse cover, <?php echo ts_change_color($main_color, 20, true, '0.94'); ?> 0%,<?php echo ts_hex_to_rgb($main_color, '0.85'); ?> 100%); background: -ms-radial-gradient(center, ellipse cover, <?php echo ts_change_color($main_color, 20, true, '0.94'); ?> 0%,<?php echo ts_hex_to_rgb($main_color, '0.85'); ?> 100%); background: radial-gradient(ellipse at center, <?php echo ts_change_color($main_color, 20, true, '0.94'); ?> 0%,<?php echo ts_hex_to_rgb($main_color, '0.85'); ?> 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f048bddb', endColorstr='#d93476a3',GradientType=1 ); } <?php ts_get_main_color_background_radial_gradient_classes(); ?> { background: <?php echo $main_color; ?> ; background: -moz-radial-gradient(50% 100%, circle farthest-side, <?php echo ts_change_color($main_color, 15); ?> , <?php echo $main_color; ?> ); background: -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100%, color-stop(0%,<?php echo ts_change_color($main_color, 15); ?> ), color-stop(100%,<?php echo $main_color; ?> )); background: -webkit-radial-gradient(50% 100%, circle farthest-side, <?php echo ts_change_color($main_color, 15); ?> , <?php echo $main_color; ?> ); background: -o-radial-gradient(50% 100%, circle farthest-side, <?php echo ts_change_color($main_color, 15); ?> , <?php echo $main_color; ?> ); background: -ms-radial-gradient(50% 100%, circle farthest-side, <?php echo ts_change_color($main_color, 15); ?> , <?php echo $main_color; ?> ); background: radial-gradient(50% 100%, circle farthest-side, <?php echo ts_change_color($main_color, 15); ?> , <?php echo $main_color; ?> ); } <?php ts_get_main_color_selection_classes(true); ?> { background-color: <?php echo $main_color; ?> ; } <?php ts_get_main_color_border_color_classes(true); ?> { border-color: <?php echo $main_color; ?> ; } <?php ts_get_main_color_border_top_color_classes(true); ?> { border-top-color: <?php echo $main_color; ?> ; } <?php ts_get_main_color_border_bottom_color_classes(true); ?> { border-bottom-color: <?php echo $main_color; ?> ; } <?php ts_get_main_color_border_left_color_classes(true); ?> { border-left-color: <?php echo $main_color; ?> ; } <?php ts_get_main_color_border_right_color_classes(true); ?> { border-right-color: <?php echo $main_color; ?> ; } .vertical.top-left .z-active .z-link { -webkit-box-shadow: inset 1px 0 0 0 <?php echo $main_color; ?> ; box-shadow: inset 1px 0 0 0 <?php echo $main_color; ?> ; } .vertical.top-right .z-active .z-link { -webkit-box-shadow: inset -1px 0 0 0 <?php echo $main_color; ?> ; box-shadow: inset -1px 0 0 0 <?php echo $main_color; ?> ; } .bottom-left .z-active .z-link, .bottom-right .z-active .z-link, .bottom-center .z-active .z-link { box-shadow: inset 0 -1px 0 0 <?php echo $main_color; ?> ; } .z-active .z-link { box-shadow: inset 0 1px 0 0 <?php echo $main_color; ?> ; } <?php } ?> <?php if (ot_get_option('main_body_text_color')) { ?> /* main_body_text_color */ <?php ts_get_main_body_text_color_classes(true); ?> { color: <?php echo ot_get_option('main_body_text_color'); ?> ; } <?php } ?> <?php if (ot_get_option('header_background_color')) { ?> /* header_background_color */ <?php ts_get_header_background_color_classes(true); ?> { background-color: <?php echo ot_get_option('header_background_color'); ?> ; } <?php } ?> <?php if (ot_get_option('page_title_background_color')) { ?> /* page_title_background_color */ <?php ts_get_page_title_background_color_classes(true); ?> { background-color: <?php echo ot_get_option('page_title_background_color'); ?> !important; } <?php } ?> <?php if (ot_get_option('menu_background_color')) { ?> /* menu_background_color */ <?php ts_get_menu_background_color_classes(true); ?> { background-color: <?php echo ts_hex_to_rgb(ot_get_option('menu_background_color'), ot_get_option('menu_background_transparency')); ?> ; } <?php } ?> <?php if (ot_get_option('headers_text_color')) { ?> /* headers_text_color */ <?php ts_get_headers_text_color_classes(true); ?> { color: <?php echo ot_get_option('headers_text_color'); ?> ; } <?php } ?> <?php if (ot_get_option('preheader_background_color')) { ?> /* preheader_background_color */ <?php ts_get_preheader_background_color_classes(true); ?> { background-color: <?php echo ot_get_option('preheader_background_color'); ?> ; } <?php } ?> <?php if ($menu_background_color) { ?> /* menu_background_color */ <?php ts_get_menu_background_color_classes(true); ?> { background-color: <?php echo $menu_background_color; ?> !important; background-image: none; } <?php } ?> <?php if (ot_get_option('sub_menu_background_color')) { ?> <?php if (in_array(ts_get_main_menu_style(), array('style4')) || isset($_GET['switch_main_menu_style']) && in_array($_GET['switch_main_menu_style'], array('style4'))) { ?> <?php ts_get_sub_menu_background_color_2_classes(true); ?> { background-color: <?php echo ts_hex_to_rgb(ot_get_option('sub_menu_background_color'), ot_get_option('menu_background_transparency')); ?> !important; } <?php } else { ?> <?php ts_get_sub_menu_background_color_classes(true); ?> { background-color: <?php echo ot_get_option('sub_menu_background_color'); ?> !important; } <?php } ?> /*.headerstyle4 .menu li ul li a { background-color: transparent; }*/ <?php } ?> <?php if (ot_get_option('body_background_color_1')) { ?> /* body_background_color_1 */ <?php ts_get_body_background_color_1_classes(true); ?> { background-color: <?php echo ot_get_option('body_background_color_1'); ?> !important; } <?php } ?> <?php if (ot_get_option('body_background_color_2')) { ?> /* body_background_color_2 */ <?php ts_get_body_background_color_2_classes(true); ?> { background-color: <?php echo ot_get_option('body_background_color_2'); ?> !important; } <?php } ?> <?php if (ot_get_option('preheader_background_color')) { ?> /* preheader_background_color */ <?php ts_get_preheader_background_color_classes(true); ?> { background-color: <?php echo ot_get_option('preheader_background_color'); ?> !important; } <?php } ?> <?php if (ot_get_option('preheader_text_color')) { ?> /* preheader_text_color */ <?php ts_get_preheader_text_color_classes(true); ?> { color: <?php echo ot_get_option('preheader_text_color'); ?> !important; } <?php } ?> <?php if (ot_get_option('footer_background_color')) { ?> /* footer_background_color */ <?php ts_get_footer_background_color_classes(true); ?> { background-color: <?php echo ot_get_option('footer_background_color'); ?> !important; } <?php } ?> <?php if (ot_get_option('footer_headers_color')) { ?> <?php ts_get_footer_headers_color_classes(true); ?> { color: <?php echo ot_get_option('footer_headers_color'); ?> ; } <?php } ?> <?php if (ot_get_option('footer_main_text_color')) { ?> /* footer_main_text_color */ <?php ts_get_footer_main_text_color_classes(true); ?> { color: <?php echo ot_get_option('footer_main_text_color'); ?> ; } <?php } ?> <?php if (ot_get_option('footer_second_text_color')) { ?> /* footer_second_text_color */ <?php ts_get_footer_second_text_color_classes(true); ?> { color: <?php echo ot_get_option('footer_second_text_color'); ?> ; } <?php } ?> <?php if (ot_get_option('copyrights_bar_background')) { ?> /* copyrights_bar_background */ <?php ts_get_copyrights_bar_background_classes(true); ?> { background-color: <?php echo ot_get_option('copyrights_bar_background'); ?> !important; } <?php } ?> <?php if (ot_get_option('copyrights_bar_text_color')) { ?> /* copyrights_bar_text_color */ <?php ts_get_copyrights_bar_text_color_classes(true); ?> { color: <?php echo ot_get_option('copyrights_bar_text_color'); ?> ; } <?php } ?> <?php if (1 == 2) { //fake </style> tag, reguired only for editor formatting, please don't remove ?> </style> <?php } ?> <?php if ($ajax_request === true) { die; } }
/** * Control panel * * Shows the Control Panel on your homepage if enabled. * * @package framework * @since framework 1.0 */ if (ts_check_if_use_control_panel_cookies() && isset($_COOKIE['theme_body_class'])) { $body_class = $_COOKIE['theme_body_class']; } elseif (isset($_GET['switch_layout']) && !empty($_GET['switch_layout'])) { $body_class = $_GET['switch_layout']; } else { $body_class = ot_get_option('body_class'); } $main_menu_style = ts_get_main_menu_style(); $background_patterns = ts_get_background_patterns(true); ?> <div id="control-panel"> <div class="panel-container"> <div class="panel-header"> <?php _e('Style Switcher', 'framework'); ?> </div> <div class="panel-content"> <h3><?php _e('Choose layout', 'framework'); ?> </h3> <select>
</head> <body <?php body_class(); ?> > <?php if (ot_get_option('control_panel') == 'enabled_admin' && current_user_can('manage_options') || ot_get_option('control_panel') == 'enabled_all') { ?> <?php get_template_part('framework/control-panel'); ?> <?php } ?> <?php switch (ts_get_main_menu_style()) { case 'style2': get_template_part('inc/headerstyle2'); break; case 'style3': get_template_part('inc/headerstyle3'); break; case 'style4': get_template_part('inc/headerstyle4'); break; default: get_template_part('inc/headerstyle1'); break; } ?>
} elseif (is_author()) { global $wp_query; $curauth = $wp_query->get_queried_object(); $title = sprintf(__('Posts by %s', 'circles'), $curauth->nickname); } elseif (is_single()) { if (get_post_type() == 'post') { $title = __('Blog', 'circles'); } else { $title = get_the_title(); if (ts_get_main_menu_style() == 'style2') { $subtitle = get_post_meta(get_the_ID(), 'subtitle', true); } } } elseif (is_page()) { $title = get_the_title(); if (ts_get_main_menu_style() == 'style2') { $subtitle = get_post_meta(get_the_ID(), 'subtitle', true); } } else { if (is_404()) { $title = __('404 Page Not Found', 'circles'); } else { if (function_exists('is_woocommerce') && is_woocommerce()) { $title = __('Shop', 'circles'); } else { $title = get_bloginfo('name'); } } } $titlebar = get_post_meta(get_the_ID(), 'titlebar', true); $no_titlebar = false;