Site logo

Archived topic

Switch off masonry on specific taxonomies

32 replies · Started by Hans on August 12, 2018

Viewing posts 16–30 of 33

Hi Tom,

thanks for your ongoing help. Two points:

- I want to have three columns instead of one - as they are in posts.
- Why have the menu points 'Beisitzer' and 'Beisitzer AsF UB ..." in 'Examples' three columns and are not masonry?

I appreciate your support very much.

Really strange that columns are turning off if masonry is turned off. I'm going to need to look at tat in the core plugin.

I wonder if it would be easier to apply masonry to a set of taxonomies instead of excluding them. Would that work for you?

Those two pages are still using masonry.

Hi Tom,

excluding is in my view the only way as there are many categories and tags which are or may be used with masonry. The only way could be to exclude all taxonomies of post type 'mitglieder'. Is there a way to do this?

I definately want to use three columns. For the time being I fixed the size of images - but this is no solution as title might have two lines in smaller views.

Looking into this - seems there might be a bug in the plugin I need to figure out.

Will let you know.

Hi Tom,

is there any news???

Hi Hans,

Sorry - not yet! I'm hoping to get it fixed for 1.7.3 which will be released soon. Will update you as soon as I have something :)

I have this fixed in 1.7.3.

If you're comfortable modifying code, I can give you instructions to add the fix for now.

Let me know :)

Hi Tom,

that would be great!

Open up: wp-content/plugins/gp-premium/blog/functions/columns.php

On line 63, right above return $masonry;, add this:

if ( false === apply_filters( 'generate_blog_masonry', 'false' ) ) {
    $masonry = 'false';
}

Then in your custom functions, add this function:

add_action( 'wp', function() {
    add_filter( 'generate_blog_masonry','tu_portfolio_masonry' );
} );

function tu_portfolio_masonry( $masonry ) {
    $taxonomies = array(
        'some-taxonomy',
        'another-taxonomy',
        'one-more',
    );

    if ( is_tax( $taxonomies ) ) {
        return false;
    }

    return $masonry;
}

Hi Tom,

great - it works. But it must be: return true. It was no problem to correct this.

return true will enable masonry within those taxonomies.

Hi Tom,

unfortunately I have to come back to this problem. It is not solved as you can see on the attached images.

This image shows the screen with masonry "true".

masonry true

This image shows the screen with masonry "false".

Masonry false

This is the only difference in the code. Nevertheless the three columns are lost and only one column is used.

Can you show me your complete code as of now?

Have you tried returning false on the pages where you don't want masonry instead of returning true on pages where you do?

Yes, I did. What I want to achieve is really simple:

I want to display three columns and all boxes should have the same size independant of the length of the heading - see first picture.

This archived topic is closed to new replies.