Home › Forums › Support › Mansory for Custom Post Type not working This topic has 13 replies, 2 voices, and was last updated 8 years, 7 months ago by Tom. Viewing 14 posts - 1 through 14 (of 14 total) Author Posts March 30, 2016 at 7:33 am #182879 Dhruv Hi Tom I have created a custom post type. But Mansory is not working in custom post type. Pls suggest me any method/code to achieve this. Regards March 30, 2016 at 9:11 am #182929 TomLead Developer Lead Developer This topic might help: https://generatepress.com/forums/topic/make-masonry-work-for-custom-post-types/page/2/#post-173226 March 31, 2016 at 9:19 am #183188 Dhruv Dear Tom I have tried this code before starting this thread. I again tried but no luck. I also tried other codes like.. add_filter( ‘generate_blog_masonry’,’generate_adjust_masonry’ ); function generate_adjust_masonry( $masonry ) { if ( ‘quote’ == get_post_type() ) : return ‘true’; endif; return $masonry; } This code is creating masory for archive pages but single posts are also showing in small mansory grids. Pls help me. March 31, 2016 at 12:04 pm #183256 TomLead Developer Lead Developer Your code would be: add_filter( 'generate_blog_masonry','generate_adjust_masonry' ); function generate_adjust_masonry( $masonry ) { if ( is_post_type_archive( 'quote' ) ) : return 'true'; endif; return $masonry; } March 31, 2016 at 11:10 pm #183345 Dhruv This Code is not Working π April 1, 2016 at 12:05 am #183352 TomLead Developer Lead Developer Can you link me to the page? April 1, 2016 at 5:41 am #183403 Dhruv http://powerwithin.in/quote-topic/motivational-quotes/ April 1, 2016 at 10:15 am #183469 TomLead Developer Lead Developer That’s not the custom post type archive. Your code would be: add_filter( 'generate_blog_masonry','generate_adjust_masonry' ); function generate_adjust_masonry( $masonry ) { if ( is_tax( 'quote-topic' ) ) : return 'true'; endif; return $masonry; } April 1, 2016 at 10:21 am #183472 Dhruv Thanks Tom This is working. April 1, 2016 at 10:22 am #183474 TomLead Developer Lead Developer You’re welcome π April 1, 2016 at 10:30 am #183480 Dhruv Is there any way to archive all posts of custom post type. I am so newbie that .. I am not able to figure out what should be the URL link for custom post type archives. When I go to http://www.MyDomain.com/archives/ I get a 404. April 1, 2016 at 11:21 am #183499 TomLead Developer Lead Developer This might help: http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/ April 1, 2016 at 11:35 am #183502 Dhruv Thanks Tom I went to Settings Β» Permalinks. and clicked save again. This worked and 404 error problem was resolved. My all issues are resolved. April 1, 2016 at 11:39 am #183503 TomLead Developer Lead Developer Awesome π Author Posts Viewing 14 posts - 1 through 14 (of 14 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In