function sf_base_sidebar($type) { // VARIABLES global $post, $sf_options; // DEFAULT SIDEBAR CONFIG $default_sidebar_config = $sf_options['default_sidebar_config']; $default_left_sidebar = $sf_options['default_left_sidebar']; $default_right_sidebar = $sf_options['default_right_sidebar']; $buddypress = sf_is_buddypress(); $bbpress = sf_is_bbpress(); $sidebar_config = $left_sidebar = $right_sidebar = $sidebar_progress_menu = ""; // ARCHIVE / CATEGORY SIDEBAR CONFIG if (is_search() || is_archive() || is_author() || is_category() || is_home()) { $default_sidebar_config = $sf_options['archive_sidebar_config']; $default_left_sidebar = $sf_options['archive_sidebar_left']; $default_right_sidebar = $sf_options['archive_sidebar_right']; } // DIRECTORY ARCHIVE if (is_post_type_archive('directory')) { $sidebar_config = "no-sidebars"; } // PORTFOLIO CATEGORY SIDEBAR CONFIG if (is_tax('portfolio-category')) { $sidebar_config = "no-sidebars"; } if (is_tax('download_category')) { $default_left_sidebar = 'crowdfunding-sidebar'; $default_right_sidebar = 'crowdfunding-sidebar'; } // BUDDYPRESS SIDEBAR CONFIG if ($buddypress != "") { $default_sidebar_config = $sf_options['bp_sidebar_config']; $default_left_sidebar = $sf_options['bp_sidebar_left']; $default_right_sidebar = $sf_options['bp_sidebar_right']; } // BBPRESS SIDEBAR CONFIG if ($bbpress) { $default_sidebar_config = $sf_options['bb_sidebar_config']; $default_left_sidebar = $sf_options['bb_sidebar_left']; $default_right_sidebar = $sf_options['bb_sidebar_right']; } // CURRENT POST/PAGE SIDEBAR CONFIG if ($post && is_singular()) { $sidebar_config = sf_get_post_meta($post->ID, 'sf_sidebar_config', true); $left_sidebar = sf_get_post_meta($post->ID, 'sf_left_sidebar', true); $right_sidebar = sf_get_post_meta($post->ID, 'sf_right_sidebar', true); $sidebar_progress_menu = sf_get_post_meta($post->ID, 'sf_sidebar_progress_menu', true); } if (is_404()) { $sidebar_config = $sf_options['404_sidebar_config']; $left_sidebar = $sf_options['404_left_sidebar']; $right_sidebar = $sf_options['404_right_sidebar']; } // DEFAULTS if ($sidebar_config == "") { $sidebar_config = $default_sidebar_config; } if ($left_sidebar == "") { $left_sidebar = $default_left_sidebar; } if ($right_sidebar == "") { $right_sidebar = $default_right_sidebar; } // EVENTS if ($type == "events-ls") { $sidebar_config = "left-sidebar"; $left_sidebar = "events-sidebar-left"; } if ($type == "events-rs") { $sidebar_config = "right-sidebar"; $right_sidebar = "events-sidebar-right"; } if ($type == "events-bs") { $sidebar_config = "both-sidebars"; $left_sidebar = "events-sidebar-left"; $right_sidebar = "events-sidebar-right"; } // Sidebar Progress Menu if ($sidebar_progress_menu == "left-sidebar" && !($sidebar_config == "left-sidebar" || $sidebar_config == "both-sidebars")) { $sidebar_config = "left-sidebar"; } if ($sidebar_progress_menu == "right-sidebar" && !($sidebar_config == "right-sidebar" || $sidebar_config == "both-sidebars")) { $sidebar_config = "right-sidebar"; } if ($sidebar_progress_menu == "left-sidebar") { $left_sidebar = ""; add_action('sf_before_left_sidebar', 'sf_side_progress_menu'); } if ($sidebar_progress_menu == "right-sidebar") { $right_sidebar = ""; add_action('sf_before_right_sidebar', 'sf_side_progress_menu'); } // SET SIDEBAR GLOBAL sf_set_sidebar_global($sidebar_config); // PAGE WRAP CLASS $page_wrap_class = ''; if ($sidebar_config == "left-sidebar") { $page_wrap_class = 'has-left-sidebar has-one-sidebar row'; } else { if ($sidebar_config == "right-sidebar") { $page_wrap_class = 'has-right-sidebar has-one-sidebar row'; } else { if ($sidebar_config == "both-sidebars") { $page_wrap_class = 'has-both-sidebars row'; } else { $page_wrap_class = 'has-no-sidebar'; } } } if ($sidebar_progress_menu == "left-sidebar" || $sidebar_progress_menu == "right-sidebar") { $page_wrap_class .= ' has-progress-menu progress-menu-' . $sidebar_progress_menu; } if (is_singular('post') || is_singular('portfolio') || is_singular('team')) { $sidebar_config = "no-sidebar"; } // RETURN $sidebar_var = array(); $sidebar_var['config'] = $sidebar_config; $sidebar_var['left'] = strtolower($left_sidebar); $sidebar_var['right'] = strtolower($right_sidebar); $sidebar_var['page_wrap_class'] = $page_wrap_class; return $sidebar_var; }
$fancy_title_image_url = $detail_image['url']; break; } $sidebar_config = sf_get_post_meta($post->ID, 'sf_sidebar_config', true); $left_sidebar = sf_get_post_meta($post->ID, 'sf_left_sidebar', true); $right_sidebar = sf_get_post_meta($post->ID, 'sf_right_sidebar', true); if ($sidebar_config == "") { $sidebar_config = $default_sidebar_config; } if ($left_sidebar == "") { $left_sidebar = $default_left_sidebar; } if ($right_sidebar == "") { $right_sidebar = $default_right_sidebar; } sf_set_sidebar_global($sidebar_config); $page_wrap_class = ''; if ($sidebar_config == "left-sidebar") { $page_wrap_class = 'has-left-sidebar has-one-sidebar row'; } else { if ($sidebar_config == "right-sidebar") { $page_wrap_class = 'has-right-sidebar has-one-sidebar row'; } else { if ($sidebar_config == "both-sidebars") { $page_wrap_class = 'has-both-sidebars'; } else { $page_wrap_class = 'has-no-sidebar'; } } } global $sf_has_products, $sf_include_isotope;
<?php sf_set_sidebar_global('no-sidebars'); ?> <?php if (have_posts()) { the_post(); ?> <!-- OPEN article --> <article <?php post_class('clearfix'); ?> id="<?php the_ID(); ?> "> <section class="page-content clearfix container"> <div class="content-wrap <?php echo esc_attr($content_wrap_class); ?> clearfix"> <?php echo atcf_shortcode_submit(array('editing' => is_preview() ? false : true, 'previewing' => is_preview() ? true : false)); ?> </div> </section>