0

i use a wordpress plugin (Gmedia galleries) to create galleries, i have problem when i set Thumbnail Width Mobile and Thumbnail Height Mobile to 50 because the image is not centered into the Thumbnail

50x50

Mobile view

is it possible to resize the image due to these settings?

Can anyone help me? Many thanks

0

EDIT: Can you send link to that page so I can see the css?

This is a bit of a shot in the dark, as I have only done this with adding image sizes but I am sure you should be able to alter the thumbnail crop position. Are 100% the image src is incorrect and the image isn't being cut off by css?

function setup_image_sizes() {
    set_post_thumbnail_size( 50, 50, array('center', 'center') ); 
    //Or try
    update_option( 'thumbnail_crop', array('center', 'center') );
    //I am assuming the image size is called thumbnail but it might be different if it is created in the plugin

}

add_action( 'after_setup_theme', 'setup_image_sizes' );

Reference: https://developer.wordpress.org/reference/functions/add_image_size/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.