We're merging with GenerateBlocks! Learn more here.

[Resolved] Card image problem and CPT archive layout

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Card image problem and CPT archive layout

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34101
    Annamária
    Participant

    Hi,

    I have a problem with card image (please see this page: https://verzal.kreanilla.hu/portfolio/), I can’t figure out why the first image gets cropped. (Both images are the same proportion.)

    Also, is there a way to apply the same cards layout to the CPT archives? I use this code, but can’t see any change (e.g. https://verzal.kreanilla.hu/projectcat/brand-identity/):

    // Add columns & masonry to CTP category archives
    add_filter( 'generate_blog_columns','tu_portfolio_columns' );
    function tu_portfolio_columns( $columns ) {
        if ( is_post_type_archive( 'project' ) ) {
            return true;
        }
    
        return $columns;
    }
    
    add_filter( 'generate_blog_masonry','tu_portfolio_masonry' );
    function tu_portfolio_masonry( $masonry ) {
        if ( is_post_type_archive( 'project' ) ) {
            return 'true';
        }
    
        return $masonry;
    }

    Thanks!

    #34105
    Annamária
    Participant

    Also, how can I filter the word “Category” on this page in the title?: https://verzal.kreanilla.hu/projectcat/brand-identity/
    I’d like to change it to “Projects”.

    Thanks!

    #34157
    Annamária
    Participant

    Figured everything out, except the image cropping…

    #34168
    elvin
    Moderator

    Hi there,

    For the cropping, you can try adding this CSS:

    .wpsp-card .wp-show-posts-image img, 
    .wpsp-card.wp-show-posts-columns .wp-show-posts-single .wp-show-posts-image img {
        width: 100% !important;
        height: auto !important;
    }

    But I think you should keep the default if you’re not faithfully uploading same aspect ratio images. The default CSS was written to crop images on purpose in consideration of posts with featured images of different aspect ratios.

    Let us know how it goes.

    #34208
    Annamária
    Participant

    Hi, Elvin, thanks, this made the trick, now the images look great. 🙂

    #34233
    elvin
    Moderator

    Nice one. No problem. 😀

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