Remove Woocommerce sidebar in sage theme

Hi,

I removed the Woocommerce sidebar in the libs/setup.php

function display_sidebar() {
static $display;

isset($display) || $display = !in_array(true, [
// The sidebar will NOT be displayed if ANY of the following return true.
// @link https://codex.wordpress.org/Conditional_Tags
is_404(),
is_front_page(),
is_woocommerce(),
is_page_template(‘template-fullwidth.php’),
is_page_template(‘template-custom.php’),
]);

return apply_filters(‘sage/display_sidebar’, $display);
}

like this. All pages are working only the Frontpage throws me an error.
"Fatal error: Call to undefined function Roots\Sage\Setup\is_woocommerce() "

Any suggestions what I may did wrong?
Thanks in advance.

PHP can’t find the function is_woocommerce(). It checked the top namespace, then Roots\Sage\Setup and still couldn’t find it. Is it possible that Woocommerce is not installed or activated?

Edit: I see you say it only happens on the homepage. I’m not sure why the woocommerce function would be available on other pages but not the homepage

1 Like

Oh, got it. I have the plugin: “Plugin Organizer” installed and didn´t allowed the Woocommerce to be active on the front-page. I activated the Woocommerce on the front-page to and it is working. Thanks for your hint.

How did you get rid of the woocommerce sidebar and not your themes sidebar? Right now on any WC page I have my theme sidebar and the WC sidebar all screwed up at the bottom. It’s driving me nuts!

UPDATE: Ahhh never saw this page https://roots.io/using-woocommerce-with-sage/ totally fixed everything!

1 Like