Filter “ocean_get_sidebar” doesn’t work
-
Hi, I wanted to display filter widgets in product archives as a classic sidebar, not as off-canvas. So, I found filter “ocean_get_sidebar” to conditionally display sidebar, but it doesn’t work.
This is my code:add_filter( 'ocean_get_sidebar', 'my_custom_sidebar_display' ); function my_custom_sidebar_display( $sidebar ) { // Single product if ( is_woocommerce() && is_singular( 'product' ) ) { return 'woocommerce_sidebar'; } // If taxonomy else if ( is_woocommerce() && is_product_taxonomy() ) { return 'owp_off_canvas_sidebar'; } // Return theme defined sidebar area else { return $sidebar; } }
I added that code in child’s functions.php and nothing happens. I even tried to just return (without condition) any sidebar, but the “woocommerce sidebar” is always displayed.
My goal is to have filters always visible on Woo archive pages in left sidebar, and custom widgets in right sidebar on single product view.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Filter “ocean_get_sidebar” doesn’t work’ is closed to new replies.