-1
我在店面的我的子主题中使用自定义大拇指。我正在使用ACF转发器将图像添加到滑块。为了显示我很容易地使用此代码为woocommerce早期定制尺寸的图像:非法字符串偏移“大小”
$slider_image = get_sub_field('slider_image');
$custom_image = $slider_image['sizes']['home-slider'];
,这里是我如何注册功能自定义图像:
function addthemesupport() {
remove_theme_support('post-thumbnails');
add_theme_support('post-thumbnails', array('post', 'page', 'product'));
//custom sizes:
add_image_size('home-slider', 400, 300, true);
add_image_size('home-featured', 200, 150, true);
}
add_action('after_setup_theme', 'addthemesupport', 11);
但是我得到的前端此错误:
警告:非法字符串偏移'尺寸'在...
警告:非法字符串偏移“主页滑块”在...
这些有什么问题?我拿了这部分代码: custom_image = $ slider_image ['sizes'] ['home-slider']; 来自ACF文档
[参考 - 这个错误在PHP中意味着什么?](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) – rnevius