How to change Featured image dimension ratio

Support Forums for LiveMesh Themes & Plugins Forums Appdev Theme Support How to change Featured image dimension ratio

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #26497
    palmtree
    Participant

    Hi Codemaster,

    I’m wondering how to change featured image dimension aspect ratio. As a theme default, I see it is defined around line 280 in “appdev > framework > framework.php”. I want to change these value but using child theme. It will be perhaps via child theme’s functions.php or something similar or easier?

    For example, what can I do if I want to change 'large-thumb' => array(820, 400), to 'large-thumb' => array(820, 546),?

    Thank you for looking into this.
    Palmtree

    #26590
    palmtree
    Participant

    I want to do this by using child theme… It would be great if you could give me your wisdom…!!

    #26605
    Raghavendra
    Moderator

    I will do my best with the limited wisdom I have! Here is what you need to have in your child theme –

    include_once(get_template_directory() . '/framework/framework.php');
    
    class MO_Child_Framework extends MO_Framework {
    
        
        function get_image_sizes() {
    
            if (!isset($this->image_sizes)) {
    
                $this->image_sizes = array(
                    'medium-thumb' => array(550, 400), // portfolio
                    'large-thumb' => array(820, 400), // blog
                    'square-thumb' => array(450, 450), // team etc.
                );
    
            }
            return $this->image_sizes;
        }
    }
    
    $mo_theme = new MO_Child_Framework();

    And then change the values in the child theme as you desire. You will need to run Regenerate Thumbnails plugin once you do this.

    #26610
    palmtree
    Participant

    Amazing Meteorite! Very impressive it worked like a magic:)))) Thank you so much!

    #26615
    Raghavendra
    Moderator

    Glad to hear that helped 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to change Featured image dimension ratio’ is closed to new replies.