我正在使用最近更新主题的wordpress网站。 Apache错误控制台报告主题中包含的旋转滑块的非法字符串偏移错误。我查看了代码和数据库。
错误如下:
[Fri Aug 14 15:47:42.523359 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'description' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 43
[Fri Aug 14 15:47:42.523371 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'link' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 32
[Fri Aug 14 15:47:42.523383 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'image' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 33
[Fri Aug 14 15:47:42.523396 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'image' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 36
[Fri Aug 14 15:47:42.523537 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'description' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 38
[Fri Aug 14 15:47:42.523553 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'link' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 39
[Fri Aug 14 15:47:42.523565 2015] [:error] [pid 3101] [client 66.249.83.171:27930] PHP Warning: Illegal string offset 'description' in /nas/wp/www/cluster-40875/wkog/wp-content/themes/purity/includes/slider.php on line 41
有关守则如下:
<div id="slider" class="flexslider vntd-block inner">
<ul class="slides">
<?php
$slides = get_option_tree( 'slider_slider', $option_tree, false, true, 1 );
if($slides)
foreach( $slides as $slide ) {
echo '<li>';
if($slide['link']) { echo '<a href="'.$slide['link'].'">'; }
if(strpos($slide['image'],'veented.com')) {
$img_url = $slide['image'];
} else {
$img_url = crop_img($slide['image'],960,get_option_tree('slider_height'));
}
echo '<img src="'.$img_url.'" title="'.$slide['description'].'" alt></a>';
if($slide['link']) { echo '</a>'; }
if($slide['description']){
echo '<p class="flex-caption">';
echo '<span class="slide-caption">'.$slide['description'].'</span>';
echo '</p>';
}
echo '</li>';
}
?>
</ul>
</div>
我在这里搜索过Google,各种博客,主题支持论坛。我已重新安装主题,我已禁用所有插件并按顺序启用它们。服务器上的PHP版本是PHP 5.5.9
我尝试了很多东西,但我不知道为什么首页上的滑块没有显示图像。