Example #1
0
<?php

global $smof_data, $post, $product, $ts_show_sidebar, $ts_sidebar_position, $ts_page_id;
$ts_page_object = get_queried_object();
$ts_page_id = ts_is_woo_shop() ? $ts_page_id : (is_single() ? $post->ID : get_queried_object_id());
$ts_custom_css = get_post_meta($ts_page_id, '_page_css', true);
if (is_product()) {
    $ts_show_sidebar = ts_option_vs_default('show_woocommerce_product_sidebar', 0) == 1 ? 'yes' : 'no';
} else {
    $ts_show_sidebar_option = ts_option_vs_default('show_woocommerce_page_sidebar', 1) == 1 ? 'yes' : 'no';
    $ts_show_sidebar = ts_postmeta_vs_default($ts_page_id, '_page_sidebar', $ts_show_sidebar_option);
}
$ts_sidebar_position = ts_option_vs_default('woocommerce_sidebar_position', 'right');
if (ts_is_woo_shop()) {
    $ts_sidebar_position = ts_postmeta_vs_default($ts_page_id, '_page_sidebar_position', $ts_sidebar_position);
}
get_header();
get_template_part('top');
get_template_part('title-page');
get_template_part('slider');
?>
            <div id="main-container-wrap" class="<?php 
echo esc_attr(ts_main_container_wrap_class('page'));
?>
">
                <div id="main-container" class="container clearfix" data-pos="<?php 
echo esc_attr($ts_sidebar_position);
?>
">
                    <div id="main" class="<?php 
echo esc_attr(ts_main_div_class());
Example #2
0
<?php

/*
 * The Sidebar containing the primary and secondary widget areas.
 */
global $smof_data, $ts_page_id, $post, $ts_grab_home_sidebar, $ts_show_sidebar, $ts_sidebar_position, $ts_sidebar_instance;
if (!isset($ts_show_sidebar) || ts_is_woo_shop()) {
    if (is_single()) {
        $ts_show_sidebar = ts_postmeta_vs_default($ts_page_id, '_p_sidebar', 'yes');
    } else {
        $ts_show_sidebar = ts_postmeta_vs_default($ts_page_id, '_page_sidebar', 'yes');
    }
}
if ($ts_show_sidebar == 'yes') {
    $ts_sbs = $ts_sidebar_selection_id = '';
    $ts_sidebar_selection = get_post_meta($ts_page_id, '_sbg_selected_sidebar_replacement', true);
    $ts_sidebar_selection = is_array($ts_sidebar_selection) ? $ts_sidebar_selection[0] : $ts_sidebar_selection;
    if ($ts_sidebar_selection && class_exists('sidebar_generator')) {
        $ts_sidebar_selection_options = sidebar_generator::get_sidebars();
        $ts_sidebar_selection_name = $ts_sbs = str_replace(array("\n", "\r", "\t", ' '), '', $ts_sidebar_selection);
        $ts_sidebar_selection_id = sidebar_generator::name_to_class($ts_sidebar_selection_name);
        if (!isset($ts_sidebar_selection_options[$ts_sidebar_selection_id])) {
            $ts_sidebar_selection = 0;
        }
    }
    ?>

		<div id="sidebar" class="<?php 
    echo esc_attr($ts_sbs);
    ?>
 sidebar <?php