這是我的代碼,我打電話給我的PHP文件:WordPress的不包括我的PHP文件
<section style="width:100%; height:120px; clear:both;" >
<section class="campaign_statistics" style="background-color:#EFEFEF;">
<?php include('progress_chart.php'); ?>
</section>
</section>
然而,沒有任何顯示,當我把它,並在頁面上,當我查看網頁的源文件,這是什麼我看到:
<section style="width:100%; height:120px; clear:both;" >
<section class="campaign_statistics" style="background-color:#EFEFEF;">
</section>
</section>
除了我的php之外,其他的都包括在內。所有這些在星期五都工作得很好。我今天早上去檢查我的網站,它沒有顯示那個php文件中的內容。 wordpress有問題嗎?我已經完成了所有代碼,找不到任何錯誤,並且在週末沒有做任何更改。
這裏是我的PHP文件的內容的一部分:
<?php
if ($blog_id == 1)
echo
'
<script>
var percent = String(totalProgress.getPercent());
document.write(totalProgress.toString());
</script>
'
;
if ($blog_id == 68)
echo
'
<script>
var percent = String(alumniProgress.getPercent());
document.write(alumniProgress.toString());
</script>
'
;
?>
等..有關於這20個。他們是javascript調用。
如果將include()切換到require(),會發生什麼? – andrewsi
我的一切都很好,progress_chart.php正在拉動的數據?如果它在早期工作正常,我不知道腳本是否遇到了無法處理的內容,這可能會阻止它完成並輸出圖表。 – jtlowe
你可能需要對'<?php include('/ wp-content/themes/your_theme_name/progress_chart.php')的影響做些什麼。 ?>'或'<?php include'/wp-content/themes/your_theme_name/progress_chart.php';沒有括號。 –