php - Crop thumbnail images - add_image_size - Wordpress -
i trying add thumbnail crop images, can't work correctly. have faced similar problems earlier, wasn't able solve it.
the page shows latest posts, , since of them has different horatio , size, must use thumbnail crop within functions make them appear same size , correct horatio, , not scale them different.
this code using show latest thumb
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('frontpage_thumb'); } ?> within functions.php:
if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); add_theme_support( 'nav-menus' ); } add_action( 'after_setup_theme', 'mytheme_custom_thumbnail_size' ); function mytheme_custom_thumbnail_size(){ add_image_size( 'frontpage_thumb', 300, 220, array( 'center', 'center' ) ); // hard crop center } the problem
they thumbs resize, don't crop. see page.
i have tried regenerate thumb plugin, no result.
have misunderstood "wp cropping"?
the problem appeared related thumbnails wordpress.
to solve problem did following:
- uninstall thumbnail plugin used
- install thumbnail plugin
- regenerate
Comments
Post a Comment