Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Extra massonry blog CPT

Home Forums Support Extra massonry blog CPT

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #139684
    Jurgen

    I now there are some posts that already asked the question but i can not get it done. I want to put the massonry plugin to work with thist CPT/

    I have a made custom post type called tracks.
    I Have a custom template.
    I Have a custom content template.

    Here are the files: http://pastebin.com/L30NgmuV

    Please help me!

    Jurgen

    #139722
    Tom
    Lead Developer
    Lead Developer

    Hi Jurgen,

    What have you tried to get it to work so far?

    Have you tried functions like this?:

    add_filter('generate_blog_masonry','generate_blog_enable_post_type_masonry');
    function generate_blog_enable_post_type_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('page-testing.php') )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }
    
    add_filter('generate_blog_activate_masonry','generate_blog_activate_page_template_masonry');
    function generate_blog_activate_page_template_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('page-testing.php') )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }

    Of course, you’ll have to change the if conditional to match your page template or custom post type, but that should do it.

    #139783
    Jurgen

    yes i tried it but then the blog page doesn’t work any more. And the CPT work but without grid.

    #139824
    Tom
    Lead Developer
    Lead Developer

    Can you show me the grid you’re using?

    You’re wanting the blog to be masonry as well, correct?

    #139863
    Jurgen

    Hi Tom,
    I want the grid and the cpt masonry. But when i activate the functions only the cpt work and the blog dont. I want my cpt the same as the blog you can view it @ http://www.moombahteam.com. This code i put in my functions.

    add_filter('generate_blog_masonry','generate_blog_enable_post_type_masonry');
    function generate_blog_enable_post_type_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('releases-template.php') )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }
    
    add_filter('generate_blog_activate_masonry','generate_blog_activate_page_template_masonry');
    function generate_blog_activate_page_template_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('releases-template.php') )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }
    #139900
    Tom
    Lead Developer
    Lead Developer

    In that case, you’ll want to do this:

    add_filter('generate_blog_masonry','generate_blog_enable_post_type_masonry');
    function generate_blog_enable_post_type_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('releases-template.php') )
    		return 'true';
    	
            // Otherwise, enable it
    	return 'true';
    }
    
    add_filter('generate_blog_activate_masonry','generate_blog_activate_page_template_masonry');
    function generate_blog_activate_page_template_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('releases-template.php') )
    		return 'true';
    	
            // Otherwise, enable it
    	return 'true';
    }
    #139905
    Jurgen

    Hi Tom,

    That is working yes but its messing up my other pages. All the content in sections are floating to the right and i end up with a great gap at the right.

    We are almost there i think.

    #139915
    Tom
    Lead Developer
    Lead Developer

    Ok, let’s try this now..

    add_filter('generate_blog_masonry','generate_blog_enable_post_type_masonry');
    function generate_blog_enable_post_type_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('releases-template.php') )
    		return 'true';
    
    	// Check if blog
    	if ( is_home() )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }
    
    add_filter('generate_blog_activate_masonry','generate_blog_activate_page_template_masonry');
    function generate_blog_activate_page_template_masonry()
    {
    	// Check page template by file name
    	if ( is_page_template('releases-template.php') )
    		return 'true';
    
    	// Check if blog
    	if ( is_home() )
    		return 'true';
    	
            // Otherwise, enable it
    	return 'false';
    }
    #139916
    Jurgen

    Hi Tom,

    Thats was the trick. Thanks for your great support.

    #139917
    Tom
    Lead Developer
    Lead Developer
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.