[Resolved] Mansory for Custom Post Type not working

Home Forums Support [Resolved] Mansory for Custom Post Type not working

Home Forums Support Mansory for Custom Post Type not working

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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

    #182929
    Tom
    Lead Developer
    Lead Developer
    #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.

    #183256
    Tom
    Lead 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;
    }
    #183345
    Dhruv

    This Code is not Working πŸ™

    #183352
    Tom
    Lead Developer
    Lead Developer

    Can you link me to the page?

    #183403
    Dhruv
    #183469
    Tom
    Lead 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;
    }
    #183472
    Dhruv

    Thanks Tom
    This is working.

    #183474
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #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.

    #183499
    Tom
    Lead Developer
    Lead Developer
    #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.

    #183503
    Tom
    Lead Developer
    Lead Developer

    Awesome πŸ™‚

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.