- This topic has 13 replies, 2 voices, and was last updated 10 years, 4 months ago by
Tom.
-
AuthorPosts
-
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 #182929Tom
Lead DeveloperLead DeveloperMarch 31, 2016 at 9:19 am #183188Dhruv
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 #183256Tom
Lead DeveloperLead DeveloperYour 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 #183345Dhruv
This Code is not Working 🙁
April 1, 2016 at 12:05 am #183352Tom
Lead DeveloperLead DeveloperCan you link me to the page?
April 1, 2016 at 5:41 am #183403April 1, 2016 at 10:15 am #183469Tom
Lead DeveloperLead DeveloperThat’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 #183472Dhruv
Thanks Tom
This is working.April 1, 2016 at 10:22 am #183474Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
April 1, 2016 at 10:30 am #183480Dhruv
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 #183499Tom
Lead DeveloperLead DeveloperApril 1, 2016 at 11:35 am #183502Dhruv
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 #183503Tom
Lead DeveloperLead DeveloperAwesome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.