将这些代码添加到主题函数文件中。
add_image_size(\'mythumb\', 350, 200, array( \'left\', \'top\' ));
// third parameter is for cropped option, you can change that as your preference.
the_post_thumbnail( \'mythumb\' );// image with the new dimensions.
重要提示:您需要重新生成缩略图才能正常工作。您可以使用插件来实现这一点。要完成学习,请查看官方指南:
https://codex.wordpress.org/Function_Reference/add_image_size