[Resolved] Custom Post Types are hiden in Masonry

Home Forums Support [Resolved] Custom Post Types are hiden in Masonry

Home Forums Support Custom Post Types are hiden in Masonry

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #359351
    Francisco

    Good night.

    I have a problem with Custom Post Types. The posts created by them disapear in the masonry module, in the blog of the site. You can only see posts published as New Post (native in WordPress). The problem: there are many empty spaces.
    I create them with Toolset Types.

    You can see in my blog: https://escribirycorregir.com/blog/

    Thanks. See you.
    Francisco

    #359393
    Leo
    Staff
    Customer Support

    Hi there,

    You can actually apply masonry to custom post type with GP’s filter.

    More info here: https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-masonry-to-your-custom-post-type

    Let us know if this helps.

    #359588
    Francisco

    Thanks, I did what Leo said, but it didn´t word. The URL is this: https://escribirycorregir.com/blog/

    Thank you very much.
    Francisco

    #359725
    Tom
    Lead Developer
    Lead Developer

    Can you try this?:

    add_filter( 'generate_blog_masonry','tu_cpt_masonry' );
    function tu_cpt_masonry( $masonry ) {
        if ( 'cuento' == get_post_type() || 'microrrelato' == get_post_type() ) {
            return 'true';
        }
    
        return $masonry;
    }
    #359771
    Francisco

    Great! Now it´s ok.
    🙂
    Thank you very much!
    See you

    #359773
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.