Skip Navigation

[Résolu] Custom archives – not displaying sidebar when Genesis layout set

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
The customer reported that when using the Genesis framework theme with WooCommerce, the primary sidebar is missing from the shop page and product archive pages.

Solution:
Was able to reproduce this on a test website and reported this internally.

Also shared some custom code to fix the missing sidebar:
https://toolset.com/forums/topic/custom-archives-not-displaying-sidebar-when-genesis-layout-set/#post-2422313

Relevant Documentation:
n/a

This support ticket is created Il y a 2 années et 4 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Chris Il y a 2 années et 4 mois.

Assisté par: Waqar.

Auteur
Publications
#2421729

I'm trying to display the primary sidebar on a custom taxonomy archive page. The site uses Genesis and the default site layout is set to Content/Primary Sidebar. The custom taxonomy archive template is set to Content/Primary Sidebar.

The custom taxonomy archive displays WooCommerce products associated with the custom taxonomy term. It looks as though the sidebar is there but the widget content does not display. The primary sidebar and widgets are not present in the html markup
EG lien caché

A test custom taxonomy archive set to display post categories does show the primary sidebar and widget content.
Eg lien caché

Assuming something to do with WooCommerce.

All and any help much appreciated.

#2422313

Hi,

Thank you for contacting us and I'd be happy to assist.

Based on your report, I've performed some tests on my website and was able to reproduce this behavior. When using the Genesis theme, if Toolset WordPress Archive is used for the WooCommerce product archive (shop) or the product taxonomy archive, the sidebar widgets become missing.

I've shared these findings with the concerned team for further review and for now, as a temporary/quick fix, you can use the following custom code:


add_action( 'toolset_genesis_woocommerce_after_main_content', 'genesis_toolset_sidebar_fix', 1,1 );
function genesis_toolset_sidebar_fix() {
	get_sidebar('Primary Sidebar');
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.

regards,
Waqar

#2422439
Screenshot 2022-07-21 at 15.03.28.png
Screenshot 2022-07-21 at 15.03.16.png

Hi Waqar

Thank you - I think this is nearly there!

Now, the sidebar area is showing in the html, but the Primary Sidebar Widgets aren't displaying. There's a Custom HTML widget that should be displaying and isn't. Could you offer any further assistance on this?

Much appreicated.

#2422615

Thanks for the update and glad that it worked.

I couldn't reproduce this on my test website and the widgets added in the "Primary Sidebar" widget area, are showing as expected.

Can you please save the widget in the widget area again and make sure to clear all involved caches?

In case the issue persists, you're welcome to share temporary admin login details of the website, for further troubleshooting.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.

#2427053

Thank Waqar. I changed the default layout in theme settings and that seemed to sort it.
My issue is resolved now. Thank you!