- This topic has 9 replies, 2 voices, and was last updated 5 years, 5 months ago by
Tom.
-
AuthorPosts
-
September 25, 2015 at 7:44 am #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
September 25, 2015 at 11:04 am #139722Tom
Lead 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 25, 2015 at 2:35 pm #139783Jurgen
yes 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 #139824Tom
Lead DeveloperLead DeveloperCan you show me the grid you’re using?
You’re wanting the blog to be masonry as well, correct?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 26, 2015 at 5:03 am #139863Jurgen
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'; }
September 26, 2015 at 10:03 am #139900Tom
Lead 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'; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 26, 2015 at 11:29 am #139905Jurgen
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.
September 26, 2015 at 12:11 pm #139915Tom
Lead 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'; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 26, 2015 at 12:24 pm #139916Jurgen
Hi Tom,
Thats was the trick. Thanks for your great support.
September 26, 2015 at 12:30 pm #139917Tom
Lead DeveloperLead DeveloperYou’re welcome! 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.