我在functions.php的PHP代碼窗口小部件不工作
function php_execute($html){
if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}
add_filter('widget_text','php_execute',100);
安裝這個代碼,我在按鈕區這個邏輯代碼。
<?php if (is_front_page()) { ?>
Website designed and developed by <a href="https://www.akvitek.com.au/">Akvitek</a>
<?php } else { ?>
Website designed and developed by Akvitek.
<?php } ?>
我正在試圖在頁腳中使用這個小部件。
輸出顯示在所有頁面上並排顯示的文本。
這是什麼,我在這裏做錯了!
請幫忙。
我確實安裝了該插件,並在上面的小部件中使用了相同的代碼。但我得到了同樣的結果。 –
檢查您的錯誤日誌,如果在.log文件中出現任何錯誤 –
也只是改變你的主題,並測試你的主題有一些代碼與插件衝突。 –