HELP – Custom Featured Image Size in Child Theme

  • Unknown's avatar

    Firstly, sorry to create this as I’m aware there is an abundance of resources online about this very issue. It should be simple but for me and code don’t seem to get on at all.

    In a nutshell, I installed new theme and installed child theme
    I have an archive of custom featured images ready to upload but at present, the thumbnails displayed on the homepage of my site get cropped (left and right, thus chopping off text and the brand logo)

    I want to edit the featured image size on the homepage (and related posts widget) so that it scales in proportion, instead of cropping.

    From my research, this should be very straight-forward.

    a) Add a couple of lines of code to the functions.php in the child theme
    b) Install regenerate thumbnails plugin and activate it

    I’ve tried all this…it is driving me BONKERS!
    I’m clearly missing something but I can’t figure it out.

    Can somebody please help?

    I’ve attached a shot of the code as it currently is.
    The site is The Digital Crusader and you can see the problem with some of the images on the homepage where they are cropping instead of just scaling down (which they do successfully on the ‘Travel’ page of the site)

    If someone can help me out with concise instructions of how to finally fix this I would be sooo grateful!

    Thanks,

    CJ

    <?php 
    
    add_action( 'wp_enqueue_scripts', 'hellen_child_enqueue_styles');
    function hellen_child_enqueue_styles() {
    
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.min.css' );
    }
    
    if ( function_exists( 'add_theme_support' ) ) {
        add_theme_support( 'post-thumbnails' );
    
     }
     if ( function_exists( 'add_image_size' ) ) {
        add_image_size( 'my-new-thumb', 320, 180,false ); // 320 wide, 180 height, no crop, proportion scale
     }
    
    ?>
  • Unknown's avatar

    Howdy digicruz!
    Can you share the URL of the website you are looking for help with?
    This seems to be a case of Self-Hosted WordPress Website
    To know the difference between,
    WordPress Com vs WordPress ORG

    Your best way to get help is
    WordPress org Support

    You will have to register a new account there if you don’t have one.
    Hope you get your solution soon, Best Wishes..!

  • The topic ‘HELP – Custom Featured Image Size in Child Theme’ is closed to new replies.