- This topic has 9 replies, 2 voices, and was last updated 8 years, 6 months ago by Tom.
-
AuthorPosts
-
September 25, 2015 at 7:44 am #139684Jurgen
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
September 25, 2015 at 11:04 am #139722TomLead DeveloperLead DeveloperHi 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.
September 25, 2015 at 2:35 pm #139783Jurgenyes i tried it but then the blog page doesn’t work any more. And the CPT work but without grid.
September 25, 2015 at 10:46 pm #139824TomLead DeveloperLead DeveloperCan you show me the grid you’re using?
You’re wanting the blog to be masonry as well, correct?
September 26, 2015 at 5:03 am #139863JurgenHi 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'; }
September 26, 2015 at 10:03 am #139900TomLead DeveloperLead DeveloperIn 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'; }
September 26, 2015 at 11:29 am #139905JurgenHi 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.
September 26, 2015 at 12:11 pm #139915TomLead DeveloperLead DeveloperOk, 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'; }
September 26, 2015 at 12:24 pm #139916JurgenHi Tom,
Thats was the trick. Thanks for your great support.
September 26, 2015 at 12:30 pm #139917TomLead DeveloperLead DeveloperYou’re welcome! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.