2014-12-23 47 views
2

这是它的参考线:警告:非法串偏移“标题”错误

$html = '<div class="devider"><a id="back-top" class="top" href="#top">'.$atts["title"].'</a></div><hr />'; 

使用WordPress 4.1和PHP 5.5

刚搬进我的网站到一个新的这个错误是如何和显示出来上了几页:

警告:非法串在/mydomain/wp-content/themes/mytheme/include/short_code.php偏移 '标题' 上线105

+0

'var_dump($ atts);'它是什么?请告诉我们 – vaso123

回答

1

我有members.php

的警告,在许多地方,我的代码有这样的:

if($a['search'] !== false and $a['search'] !== 'false') { 
      $r .= $this->search(); 
     } 
I had to change it to this to remove the warning: 
if(isset($a['search']) !== false and isset($a['search']) !== 'false') { 
      $r .= $this->search(); 
     } 

但后来我失去了我的搜索框,所以不是不表达式的第一部分相等,我改成了等于(抢走了!):

if(isset($a['search']) == false and isset($a['search']) !== 'false') { 
$r .= $this->search(); 
} 
I had to also change a line that looked like: 
$this->list = $a['list']; 

到:

$this->list = isset($a['list']); 

希望这会有帮助..

+0

感谢您的评论Sandesh,我不确定这一切意味着什么,但我确实意识到了一些事情。每次我使用这个水平行短代码“[cs_divider]”时,错误文本会出现多少次。例如,页面中有5行比错误文本出现了5次。有什么建议? – wozmatic

相关问题