Okay
  Public Ticket #2824336
Changing the maximum dimensions of the Portfolio featured image
Closed

Comments

  •  1
    kinleonn started the conversation

    The question is simple: is there a possibility to change the max dimensions of the portfolio featured image thumbnail, which is currently at max height 220px? I would like to have larger sized thumbnails which naturally shift according to their size within the portfolio category.


    The theme is Viceversa.

  •  295
    Paul replied

    Hello,

    It is possible, but would require a bit of custom work. Please try:

    1. Create a new child theme by following this guide: https://uxbarn.ticksy.com/article/8649/

    2. In the "functions.php" file of the child theme, add this code:

    function viceversa_register_theme_image_sizes() {
            
            add_image_size( 'viceversa-blog', 640, 9999 );
            add_image_size( 'viceversa-port-list', 9999, 500 );
            add_image_size( 'viceversa-port-single-landscape', 760, 9999 );
            add_image_size( 'viceversa-port-single-portrait', 480, 9999 );
            
        }

    Notice the "'viceversa-port-list'" entry that the last number is now 500 which means 500px height (the original one is 220.)

    The "add_image_size()" is the WordPress function for creating custom image sizes to be used. For more info, please see: https://developer.wordpress.org/reference/functions/add_image_size/

    3. So, we just override the parent theme's image sizes in our child theme. In this step, install and activate the Regenerate Thumbnails plugin: https://wordpress.org/plugins/regenerate-thumbnails/

    4. Go to "Tools > Regenerate Thumbnails" and after it's done, if you check the portfolio images on the front-end, the 220px height image should now be 500px height as we set.

    I hope this helps!

    Regards,
    Paul

  •  1
    kinleonn replied

    Thank you very much, that worked a treat!


  •  295
    Paul replied

    You're most welcome! Happy to help!smile.png