Site logo

Archived topic

Masonry grid for blog and 404 page

15 replies · Started by Alena on June 11, 2021

Viewing posts 1–15 of 16

Hi, I use masonry grid for my blog and it doesn't work well with the 404 page: content div and footer div overlap. If I switch off the blog masonry grid, it works well. There is a div height 0px, see the code below. Any idea how to solve this, please?

<main id="main" class="site-main">
			<div class="generate-columns-container masonry-container" style="position: relative; height: 0px;"><div class="grid-sizer grid-33 tablet-grid-50 mobile-grid-100"></div><div class="inside-article">

	
	<header class="entry-header">
				<h1 class="entry-title" itemprop="headline">Jejda! Tuto stránku nelze nalézt.</h1>
	</header>

	
	<div class="entry-content" itemprop="text">
		...
	</div>

	
</div>
</div><!-- .generate-columns-contaier -->		
</main>

Hi there,

do you have any custom functions relating to the Blog settings on your site ? As the masonry grid should only load on archives

Hi David,

I've found out that if Display posts in columns is checked, the 404 page contains additionaly a class generate-columns-activated in the body tag and then <div class="generate-columns-container "> element in the content. If the masonry grid is check, the elements overlap additionaly.

On a test site I deleted all plugins, a child theme with css and functions and activated only the Blog item in the GP theme settings. I reinstalled the GP theme and reset all options, too, but without success. I'm not able to replicate the issue on a new test instalation.

Any idea, please? Thank you

Can you provide a temporary Admin login to the site so we can take a closer look ?

Hi David,

admin access see below. Thank you.

Hi Alena,

Can you create a dev/staging clone of your site with a completely intact with all the plugins, child themes, and contents? Kindly provide backend access as well so we can conduct an inspection to find out which is causing this.

Hi, I've just created a copy of the site.

Thank you for your help

Could you delete the GP Premium Plugin - and then download a new copy from the GP site > Account > Downloads and re-install?

It's done but the problem is still there.

I am going to ask Tom to take a look, as i tested the site without any plugins, and the parent theme and the issue was still present. But i cannot replicate it locally.

Ok, thank you! I appreciate very much your support.

Strange - I'm not able to replicate it either, but it's obviously an issue on this install.

Can you try adding the following filter in your child theme functions.php file to see if it fixes it?

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( is_404() ) {
        return false;
    }

    return $columsn;
} );

Hi Tom,
it's strange, isn't it? But the filter works fine so I will use this solution.

Thank you very much!

No problem! Let us know if it happens again :)

FWIW, I'm seeing the same thing on a site I'm working on. It manifested for me trying to replace the 404 default content using GPP 2.0 block element content template and GenerateBlock. My new content was put in a column. The filter works for me as well but it seems that, in terms of CSS classes, the 404 page is treated as a posts archive and not a regular page which is weird.

If there's a better way to do custom content using Gutenberg for a 404 page I'd love to know about it.

Thanks!

This archived topic is closed to new replies.