Site logo

Archived topic

Mansory for Custom Post Type not working

13 replies · Started by Dhruv on March 30, 2016

Viewing posts 1–14 of 14

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

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.

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;
}

This Code is not Working :(

Can you link me to the page?

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;
}

Thanks Tom
This is working.

You're welcome :)

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.

Thanks Tom

I went to Settings » Permalinks. and clicked save again.
This worked and 404 error problem was resolved.

My all issues are resolved.

Awesome :)

This archived topic is closed to new replies.