示例#1
0
function pt_disable_sidebars($sidebars_widgets)
{
    global $wp_query, $wp_customize;
    if (current_theme_supports('plumtree-layouts') && !is_admin()) {
        if (!isset($wp_customize)) {
            if ('layout-one-col' == pt_show_layout()) {
                $sidebars_widgets['sidebar-front'] = false;
                $sidebars_widgets['sidebar-pages'] = false;
                $sidebars_widgets['sidebar-shop'] = false;
                $sidebars_widgets['sidebar-blog'] = false;
                $sidebars_widgets['sidebar-product'] = false;
            }
        }
    }
    return $sidebars_widgets;
}
 function pt_output_upsells()
 {
     if ('layout-one-col' == pt_show_layout()) {
         $per_page = 4;
         $cols = 4;
     } else {
         $per_page = 3;
         $cols = 3;
     }
     woocommerce_upsell_display($per_page, $cols);
     // Display $per_page products in $cols
 }