Support » Theme: GeneratePress » masonry layout not applied to custom post type

  • Hi Tom,

    Good Evening,

    I wan’t to apply masonry layout to custom post type, which I have created as portfolio. I have followed the steps that was listed on the forum. But still layout is not applied.

    Let me tell you what I have did.

    1. Created template file named it as => masonry-portfolio.php
    2. then add following code to functions.php file

    add_filter('generate_blog_masonry','generate_blog_enable_post_type_masonry');
    function generate_blog_enable_post_type_masonry()
    {
            $type = get_post_type();
    
            // If we're on the "books" post type, enable masonry
    	if ( 'portfolio' == $type )
    		return 'true';
    
    	// Check page template by file name
    	if ( is_page_template('masonry-portfolio.php') )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }

    Is anything I did wrong??

    Any suggestions

    Thanks

    • This topic was modified 8 months, 1 week ago by pradeepphule.
    • This topic was modified 8 months, 1 week ago by pradeepphule.
Viewing 1 replies (of 1 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    The built-in masonry functionality is in our pro version, which we aren’t allowed to support on WordPress.org (it’s a forum rule here).

    Any chance you can open a topic in our premium forums, and include a link to your page?: https://generatepress.com/support

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘masonry layout not applied to custom post type’ is closed to new replies.