Unavailable sidebar due to missing source code
-
I used the plugin Widget Disable to disable the sidebar. Deactivation of the plugin does not result in having a sidebar. So I fear that this plugin permanently altered the source code.
In my source code there is something missing (so I have been told): “<div id=”secondary” ”. Does anyone know how to fix this issue?
-
This topic was modified 1 year, 2 months ago by
ronmeijers.
-
This topic was modified 1 year, 2 months ago by
-
Hi @ronmeijers,
The visibility of your sidebar may depend on the active page template. To check which template is being used, edit your page, go to the editor sidebar, and click on the current template name in the Template section. https://i.snipboard.io/Ls9Kib.jpg
That being said, you may try different page template.
Hi @kharisblank,
Thanks for your reply! I checked it, and it’s set as default template. In the meantime I found the following snippet in function.php
function sydney_set_modern_header_flag() {
update_option( 'sydney-update-header', true );
//Disable old content position code
update_option( 'sydney_woo_content_pos_disable', true );
//Disable single product sidebar
set_theme_mod( 'swc_sidebar_products', true );
//Disable shop archive sidebar
set_theme_mod( 'shop_archive_sidebar', 'no-sidebar' );
}
//add_action( 'after_switch_theme', 'sydney_set_modern_header_flag' );Based on that I created a child theme and tried the following two settings separately:
set_theme_mod( ‘shop_archive_sidebar’, ‘sidebar’ );
set_theme_mod( ‘shop_archive_sidebar’, ‘left-sidebar’ );Those however also did not result in any changes.
These were the snippets I added to the child theme’s function:
// Enable single product sidebar
function enable_single_product_sidebar() {
set_theme_mod('swc_sidebar_products', true);
}
add_action('after_switch_theme', 'enable_single_product_sidebar');
// Enable shop archive sidebar
function enable_shop_archive_sidebar() {
set_theme_mod('shop_archive_sidebar', 'left-sidebar');
}
add_action('after_switch_theme', 'enable_shop_archive_sidebar');enable_single_product_sidebar works, enable_shop_archive_sidebar doesn’t.
Hi @ronmeijers,
I’d like to investigate this further to help you better. For future reference, using this field when creating your topic would make it easier to track and resolve issues:
https://i.snipboard.io/qhy3No.jpg.
Let me know how I can assist you with this.
Hi @kharisblank,
I am working on a subdomain (staging site). It’s a clone from https://clnhouthandel.nl/. In a few days it will move to the main domain. Solving this before the planned move, would be awesome.
Hi @ronmeijers,
I checked your homepage and it uses Canvas template. Try Default template instead. Ref: https://i.snipboard.io/Ls9Kib.jpg
Hi @kharisblank,
Upon changing the template I do have a sidebar in my homepage. But that is not what I am looking for. I’d like to have a sidebar in my product overviews, so people can select a material-type for example.
So I took a deep dive and this is what I found in the page source of such an overview page:
<body data-rsssl=1 class="archive tax-product_cat term-liggers term-4298 logged-in admin-bar no-customize-support custom-background theme-sydney woocommerce woocommerce-page woocommerce-no-js mega-menu-primary menu-inline no-sidebar elementor-default elementor-kit-632" >In the child theme of my subdomain, I get the same result after changes made to functions.php. So the question appears to be: how do I change ‘no-sidebar’ to ‘sidebar’ in that line of code
But that is not what I am looking for. I’d like to have a sidebar in my product overviews, so people can select a material-type for example.
@ronmeijers, to enable the shop sidebar in Sydney, follow these steps:
- Navigate to Appearance > Customize > WooCommerce > Product Catalog > General > Layout
- Under the Sidebar section, select your preferred sidebar location
- Save your changes
Remember to clear your cache after making these updates to ensure the changes take effect immediately.
Hi @kharisblank,
I had already tried that. It makes room for a sidebar, but the sidebar does not appear when I do that.
It makes room for a sidebar, but the sidebar does not appear when I do that.
The sidebar will remain empty until you add an active widget to it.
If your widget isn’t appearing as expected, it may have specific visibility settings. In that case, please check the widget’s configuration to ensure it’s set to display on your shop page.
Let me know if you need any help with this!
The topic ‘Unavailable sidebar due to missing source code’ is closed to new replies.
