Skip Navigation

[Resolved] Theme options (Astra) not working for archive layout settings

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2623727

I'm using Toolset for archive pages and would like to hide the sidebar on empty archive pages . The settings seem to work, but if someone replaces a page number with one that results in "no items found", for some reason my sidebar is displaying on that page in spite of not enabling sidebar in archive layout settings. This is resulting in a very long page with incorrect formatting in that sidebar. There is also incorrect formatting in the footer for that page.

*As an update, I've also tried using Widget Options to only show main sidebar elements on my posts and hide these elements from archives, and they still appear to show up on those "no results" archive pages. All of these are custom HTML blocks (including the one in the footer that is displaying incorrect formatting).

#2623865

I did discover that if I used wildcards for hiding those sidebar elements with Widget Options, that does result in hiding those items from the sidebar on null archive pages. However, there is still an issue with spacing, as if the sidebar is maintaining area on the resulting page, even though when I use inspect, the element isn't there.

#2623945

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The theme options works that way that if you activate the side bar from theme option settings then it will show the side bar otherwise not.

There is no dynamic way to know that if there is no results available then the sidebar should be automatically disabled. You can use workaround you find and share here that may help other users and if you do not want to use that workaround then there is no other possible way but to hide it dynamically using some jQuery or by adding some custom CSS.

#2624089

That's the problem, though. I have sidebar disabled on pages in my theme settings. At first, I tried to select "Use Theme Settings" for the sidebar archive layout options, thinking that would work, but it didn't. I also tried selecting "No sidebar". In either case, although the sidebar isn't displayed on archive pages that have content, if someone amends the pagination to a page that doesn't exist, like category/page/10000, it still shows the sidebar on that page. I used the wildcard settings in Widget Options to hide sidebar widgets from all category/*, but I wanted to add a search box to that "no items found" page and can't center it on the page, because it still acts as if there is a sidebar there. On mobile devices, this results in a very long page with lots of whitespace after "no items found".

So, in summary, your statement "The theme options works that way that if you activate the side bar from theme option settings then it will show the side bar otherwise not." is untrue. It shows the sidebar on those pages no matter what I do. I'm curious, though, if this is an issue other Astra users experience or if this extends to all themes if you amend the pagination to a page that doesn't exist.

#2624097

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please share details on what pages you want to display the sidebar and what pages you want to hide it and send me admin access details and let me check whats going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2624121

As an update, it appears the whitespace and centering issues have resolved (guessing it was a caching issue somewhere). I don't think this problem is unique to Astra, though, because I did some comparisons to other toolset websites and noticed this one using GeneratePress has left-alignment on what I was struggling with here: hidden link