如果您想确保在切换主题时图像大小保持可用,那么应该将它们放入插件中。创建。php文件(根据需要命名)并将其放置在wp content/plugins/中,然后粘贴以下内容:
<?php
/*
Plugin Name: My Custom Image Sizes
Plugin URI: http://pippinsplugins.com/
Description: Images sizes to be used in all themes
Author: Pippin Williamson
Author URI: http://pippinsplugins.com
Version: 1.0
*/
add_image_size(\'thumb\' , 130, 65, true ); // Thumb
add_image_size(\'max\' , 610, 305, true ); // Maximum
add_image_size(\'min\' , 270, 135, true ); // Minimum
激活插件后,无论激活哪个主题,图像大小都将可用。