Skip to content

Instantly share code, notes, and snippets.

@talaia
Last active March 20, 2016 17:14
Show Gist options
  • Save talaia/10760735 to your computer and use it in GitHub Desktop.
Save talaia/10760735 to your computer and use it in GitHub Desktop.
Cropping problem with add_image_size
<?php
/*
We found a lot of problems when trying to crop images through the Wordpress' add_image_size function.
Finally, we found out that the stupidest solution was the good for us: we just deleted a dash
from the string at the first parameter. We had 'foto-portada' witch didn't work, and now, 'fotoportada', wokring well.
It's kinda weird.
If this still does'nt work, try to hook your add_image_size call into the after_setup_theme hook.
:)
*/
add_image_size('fotoportada', 400, 100, true);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment