Archived topic
Custom Post Types are hiden in Masonry
5 replies · Started by Francisco on August 3, 2017
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
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.
Thanks, I did what Leo said, but it didn´t word. The URL is this: https://escribirycorregir.com/blog/
Thank you very much.
Francisco
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;
}
Great! Now it´s ok.
:-)
Thank you very much!
See you
You're welcome :)