Image cropping
-
Dear support,
My featured images are being copped. How can I prevent this from happening?
Thanks in advance.
Best,
Bart
-
Hi Bart. You could try copying the /functions/init-core.php hu_setup() function to a child theme and change the add_image_size hard crop option from true to false:
// Thumbnail sizes add_image_size( 'thumb-small', 160, 160, false ); add_image_size( 'thumb-standard', 320, 320, false ); add_image_size( 'thumb-medium', 520, 245, false ); add_image_size( 'thumb-large', 720, 340, false );Then install and run the Regenerate Thumbnails plugin: https://wordpress.org/plugins/regenerate-thumbnails/
Here are a couple of references for image cropping:
http://www.wpexplorer.com/wordpress-image-crop-sizes/
https://havecamerawilltravel.com/photographer/wordpress-thumbnail-cropThanks for your response. That does work, however.. I want a full preview of my images, not a copped part of it.
I had managed this in the past, but aren’t sure how I did it, since there was never a need to do it again.
Do you have any suggestions?
Best,
Bart
Just discovered that the code below gives me the result that I was looking for:
`add_image_size( ‘thumb-small’, 160, 9999 );
add_image_size( ‘thumb-standard’, 320, 9999 );
add_image_size( ‘thumb-medium’, 520, 9999 );
add_image_size( ‘thumb-large’, 720, 9999 );`The thing is, I have to put in in my parent theme init-core.php file, because when I create the file in my Child-theme, wordpress seems to ignore it.
Am I doing it wrong?
Best,
Bart
when I create the file in my Child-theme
You don’t need the entire init-core.php file in your child theme. You just need to copy the hu_setup() function from init-core.php to your child theme functions.php file and make the changes there.
You are right.
That totally worked. I was under the impression that I had to have the same file names and paths in my child theme as is with the parent theme.
But functions.php is still active in today’s child themes.I should read up on it.
Thanks for your help.
Best,
Bart
I did this and now my menus are not working. http://www.politicskenya.net/
Just to clarify: I now have a child theme with a functions.php file in there. In this functions.php I only have the lines that declare the hu_setup() rules in there.
This works for me.
What not to do is to copy the init-core.php to your child theme.
This is what I did wrong the first time. Hope it helps.
Best of luck!
The topic ‘Image cropping’ is closed to new replies.
