Mika MAtikainen

Apr 15, 2020 · 4 min read

How to Create custom image sizes in wordpress?

        
        function wps_setup_images() {

        // thumb size for wide layout: post-thumbnail-narrow
        add_image_size('post-thumbnail-narrow', '900', '600', array('center', 'center')); // crop from center

        // thumb size for wide layout: post-thumbnail-wide
        add_image_size('post-thumbnail-wide', '1840', '600', array('center', 'center')); // crop from center

        }
        add_action('after_setup_theme', 'wps_setup_images');
        
    

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This