[Support request] masonry layout not applied to custom post type

Home Forums Support masonry layout not applied to custom post type

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #897399
    Somnath

    Hi Tom,

    Good Morning,

    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';
    }

    3. I have wrote down simple while loop code in masonry-portfolio.php

    What goes wrong??

    Best Regards,
    Movinnza
    https://www.movinnza.in

    #897403
    Leo
    Staff
    Customer Support
    #897571
    Somnath

    Hi Leo,

    I tried the above code, and still masonry layout is not applied to custom post type.

    Best Regards,
    Movinnza
    https://www.movinnza.in

    #897964
    Leo
    Staff
    Customer Support

    Can you link us to the site in question?

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