Archived topic
Extra massonry blog CPT
9 replies · Started by Jurgen on September 25, 2015
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
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.
yes i tried it but then the blog page doesn't work any more. And the CPT work but without grid.
Can you show me the grid you're using?
You're wanting the blog to be masonry as well, correct?
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';
}
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';
}
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.
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';
}
Hi Tom,
Thats was the trick. Thanks for your great support.
You're welcome! :)
