Skip Navigation

[Resolved] Gallery Block Columns Gone for Logged Out Users

This support ticket is created 2 years, 12 months ago. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 6 replies, has 2 voices.

Last updated by Timothy 2 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#2232705

I have a gallery block on this page and the 4 columns work and look fine when logged in, but when logged out it's just one column:

hidden link

Tim

#2232849

Hi Tim,

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

If the gallery's styles are loading correctly for the logged-in user, most likely some cache or code optimization plugin is showing a cached version of the page to non-logged-in guest visitors.

To troubleshoot this, I'll suggest the following steps:

1. Please make sure that WordPress, active theme, and plugins are all updated to the latest versions.

2. It would be interesting to test this with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One.

If it's fixed, you can start adding the disabled items, one by one, to narrow down to a possible conflicting one.

3. In case the issue still persists, I'll need to see how this gallery block is set up in the admin area, for further investigation. You're welcome to share temporary admin login details in reply to this message.

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

regards,
Waqar

#2233485

I also deactivated all plugins except types/views, but the issue was still there. And on this staging site caching is not activated, so it cannot be a caching issue.

Tim

#2234183

Thank you for sharing these details.

I've performed several tests on my website, but couldn't reproduce this issue. This suggests that something specific to your website is involved.

Do I have your permission to download a clone/snapshot of the website, to investigate this on a different server?

#2234331

Yes. Thanks.

Tim

#2235245

Thank you for the permission.

During troubleshooting on your website's clone, I noticed that issue with the gallery styles for non-logged-in users, only appears, if the "Astra Child" theme is active. If the active theme is changed to "Astra" or any other theme, it gets fixed.

In your "Astra Child" theme's "functions.php" file, I found this code, which is responsible for this conflict:


// eliminate render blocking js and css
function defer_parsing_of_js( $url ) {
    if ( is_user_logged_in() ) return $url; 
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    return str_replace( ' src', ' defer src', $url );
}
add_filter( 'script_loader_tag', 'defer_parsing_of_js', 10 );

Removing this, fixes the script error from the console and the gallery styles are also loaded correctly.

#2235569

My issue is resolved now. Thank you!