Site logo

Archived topic

Masonry on custom post type broken with 3.0.0

11 replies · Started by Thomas on October 6, 2020

Viewing posts 1–12 of 12

Hi there,
we used the masonry option on a custom post type page. It worked fine until the 3.0.0 version.
Heres the code we have been using:

function kupf_portfolio_masonry( $masonry ) {
    if ( is_singular( 'zeitungsausgabe' ) ) {
		return 'true';
    }
    return $masonry;
}
add_filter( 'generate_blog_masonry','kupf_portfolio_masonry' );

Here is an example page where the boxes on the right side should use the masonry layout: https://kupf.at/zeitung/175/
All help appreciated!

PS: Love the new 3.0 Update!

Hi there,

Strange, looks like a possible bug in GPP 1.12.1.

Can you try adding this as well?:

add_filter( 'generate_blog_columns', function( $columns ) {
    if ( is_singular( 'zeitungsausgabe' ) ) {
        return true;
    }

    return $columns;
} );

Thanks, still not working though =/

I suppose it should load the columns.css from the gp premium directory?
Seems like its not doing this.

We have the columns option in the customizer deactived (because we don't want them in the blog). Maybe the hook is not working if the setting is off?

Ah, you're using masonry on your single posts, interesting. Typically I would suggest a custom solution for that, as the built-in option is specifically built for archives.

However, you can try adding the column CSS yourself:

.grid-33 {
    width: 33.3333%;
}

Well, not exactly: Its the single of a custom post type (left column, "zeitungsausgabe" or magazin) which lists all entries of another related custom post type (right columns, "zeitungsartikel" or magazin-articles).

Yeah, copying the css would work (I use more than the 33 grid style, additionally I need the different mobile versions too).

I still would prefer if we could fix it in the core =). It was working perfectly fine for the last two years. Any chance for that?

It will take some testing to fix this which likely won't happen until a feature release. The blog columns are built to work on archives, so they're disabled on single posts (regardless of post type) by default.

I'll play with it for 1.12.2 - if we can figure out a solid way to fix it, or a solid way to enable it via filter, we will :)

Just an update here - looks like we'll have this fixed in 1.12.2 :)

Cool, thanks a lot!
I love your support, it's really great.

We just released 1.12.2 which should fix this.

Let me know :)

Yeah, works as expected now, thanks a lot!

Awesome - thanks for reporting the issue! :)

This archived topic is closed to new replies.