/** * Add sidebar if it's enabled in theme settings * @since 1.4.6 */ function themify_wc_compatibility_sidebar() { // Check if WC is active and this is a WC-managed page if (!themify_is_woocommerce_active() || !function_exists('is_woocommerce') || !is_woocommerce()) { return; } $sidebar_layout = 'sidebar1'; if (is_product()) { if (themify_check('setting-single_product_layout')) { $sidebar_layout = themify_get('setting-single_product_layout'); } elseif (themify_check('setting-default_page_post_layout')) { $sidebar_layout = themify_get('setting-default_page_post_layout'); } } else { global $wp_query; if (isset($wp_query->queried_object) && isset($wp_query->queried_object->ID)) { $sidebar_layout = get_post_meta($wp_query->queried_object->ID, 'page_layout', true); } elseif (themify_check('setting-shop_layout')) { $sidebar_layout = themify_get('setting-shop_layout'); } elseif (themify_check('setting-default_layout')) { $sidebar_layout = themify_get('setting-default_layout'); } } themify_ecommerce_sidebar_before(); // Hook if ($sidebar_layout != 'sidebar-none') { get_sidebar(); } themify_ecommerce_sidebar_after(); // Hook }
/** * Add sidebar if it's enabled in theme settings * @since 1.4.6 */ function themify_wc_compatibility_sidebar() { // Check if WC is active and this is a WC-managed page if (!themify_is_woocommerce_active() || !function_exists('is_woocommerce') || !is_woocommerce()) { return; } $sidebar_layout = 'sidebar1'; if (is_product()) { if (themify_check('setting-single_product_layout')) { $sidebar_layout = themify_get('setting-single_product_layout'); } elseif (themify_check('setting-default_page_post_layout')) { $sidebar_layout = themify_get('setting-default_page_post_layout'); } } else { if (is_shop()) { $woo_page_layout = get_post_meta(get_option('woocommerce_shop_page_id'), 'page_layout', true); if ($woo_page_layout == 'default') { if (themify_check('setting-shop_layout')) { $sidebar_layout = themify_get('setting-shop_layout'); } elseif (themify_check('setting-default_layout')) { $sidebar_layout = themify_get('setting-default_layout'); } } else { $sidebar_layout = $woo_page_layout; } } } themify_ecommerce_sidebar_before(); // Hook if ($sidebar_layout != 'sidebar-none') { get_sidebar(); } themify_ecommerce_sidebar_after(); // Hook }
/** * Add sidebar if it's enabled in theme settings * @since 1.4.6 */ function themify_wc_compatibility_sidebar() { // Check if WC is active and this is a WC-managed page if (!themify_is_woocommerce_active() || !is_woocommerce()) { return; } $sidebar_layout = 'sidebar1'; if (is_product()) { if (themify_check('setting-single_product_layout')) { $sidebar_layout = themify_get('setting-single_product_layout'); } elseif (themify_check('setting-default_page_post_layout')) { $sidebar_layout = themify_get('setting-default_page_post_layout'); } } else { if (themify_check('setting-shop_layout')) { $sidebar_layout = themify_get('setting-shop_layout'); } elseif (themify_check('setting-default_layout')) { $sidebar_layout = themify_get('setting-default_layout'); } } themify_ecommerce_sidebar_before(); // Hook if ($sidebar_layout != 'sidebar-none') { get_sidebar(); } themify_ecommerce_sidebar_after(); // Hook }