【发布时间】:2013-11-28 06:59:18
【问题描述】:
我有这段代码,它运行良好,但我的一个客户得到了
致命错误:不能将字符串偏移量用作数组
我注释了产生错误的那一行。
<?php
$thumbId1 = get_field('portfolio_images'); //this is the line that generates the error
$portfolio_large = $thumbId1[0]['image'];
$mafioso_smvideo = get_field('small_video',$post->ID);
if($mafioso_smvideo!='') {
echo do_shortcode($mafioso_smvideo);
}
elseif (!$portfolio_large == ''){
?>
<?php
echo '<img src="'.aq_resize( $portfolio_large, 340, 197, true ).'" alt="'.get_the_title().'" class="categ-thumb"/>';
?>
【问题讨论】:
-
请发布get_field函数。
-
这是一个重复的问题:stackoverflow.com/questions/3059927/…