0

我正在一个主题最近更新的 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> 

我在这里搜索过,谷歌,各种博客,主题的支持论坛。我已经重新安装了主题,我禁用了所有插件并按顺序启用它们。服务器上的 PHP 版本是 PHP 5.5.9

我尝试了很多东西,但我不知道为什么首页上的滑块不显示图像。

4

0 回答 0