我收到此错误:
解析错误:语法错误,意外'<'在/home/.../public_html/lagatar.com/wp-content/themes/.../footer.php上线
在我的footer.php中为likebox添加了facebook的代码之后,上面的错误出现在我网站的页脚下面。
<?php
/* Prevent direct access to this file */
if ( !defined('WP_CONTENT_DIR') )
die('Please do not access this file directly.');
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=204491109624023&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
/* WordPress and a lot of plugins require the function in this file, so I guess we have to use it :-(. */
wp_footer();
Display::body_close();
Display::html_close();
答案 0 :(得分:2)
您不小心在PHP标记中插入了HTML,您应该这样做:
<?php
/* Prevent direct access to this file */ if ( !defined('WP_CONTENT_DIR') ) die('Please do not access this file directly.');
?>
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=204491109624023&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
<?php
/* WordPress and a lot of plugins require the function in this file, so I guess we have to use it :-(. */
wp_footer();
Display::body_close();
Display::html_close();