[Resolved] Masonry Layout – No Vertical Spacing Between Posts

Home Forums Support [Resolved] Masonry Layout – No Vertical Spacing Between Posts

Home Forums Support Masonry Layout – No Vertical Spacing Between Posts

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #121528
    Chris

    Activated the Masonry option and for some reason there it’s not registering the vertical spacing setting between the posts. Subsequent posts overlap the bottom of the previous post in the columns.

    When in preview mode when customizing it does show the vertical spacing between posts just fine.

    See here:
    http://www.roadbikeoc.com/

    Any thoughts?

    #121579
    Tom
    Lead Developer
    Lead Developer

    Hmm, I believe this is being caused by the social icons plugin, which is waiting until masonry is initiated to show up.

    When they show up, they increase the height of the container, which is where the issue is coming from.

    Try adding a height to the container so masonry knows it’s there even before the icons load:

    .shareaholic-canvas {
          height: 75px;
    }

    You may have to adjust that 75px.

    #121589
    Chris

    Perfect. Fixed it!

    Thanks!

    #121600
    Chris

    What’s the PHP code (filter) to use to apply the Masonry layout only for the home page? I saw something a while back in the Support threads but can’t find it now.

    #121601
    Chris
    #121604
    Tom
    Lead Developer
    Lead Developer

    Sure is – this will work for your front page:

    add_filter('generate_blog_masonry','generate_blog_enable_home_masonry');
    function generate_blog_enable_home_masonry()
    {
            // If we're on the posts page, enable masonry
    	if ( is_front_page() )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.