2014-12-23 51 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

相關問題