【发布时间】:2020-04-23 00:56:56
【问题描述】:
我正在使用来自here 的演示主题
我使用 FlyWheel 在 Wordpress 上安装了 BeTheme。我安装/激活了插件,然后激活了演示并选择了 Gym 主题。之后我收到以下错误:
解析错误:语法错误,C:\Users\Inspiron 14 5000\Local Sites\coastal-hideaways\app\public\wp-content\themes\betheme\header.php 第 57 行中的意外“}”
下面是header.php第57行的代码
<body <?php body_class(); ?>><?php if( is_front_page() ) {$month = date("n");switch (ceil($month/3)) {case 1:?><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">yazılım</a><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">web sitesi</a><a href="https://my-shuttle.eu/de/5460/frankfurt-flughafenzubringer?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);" target="blank">flughafentransfer frankfurt</a><a href="https://my-shuttle.eu/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);" target="blank">flughafentransfer</a><?phpbreak;case 2:?><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">yazılım firması</a><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">istanbul yazılım</a><a href="https://my-shuttle.eu/de/4962/berlin-flughafenzubringer?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">flughafentransfer Berlin</a><a href="https://my-shuttle.eu/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">flughafentransfer</a><?phpbreak;case 3:?><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">web tasarım</a><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">web design</a><a href="https://my-shuttle.eu/tr/5407/deutschland-hamburg?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">flughafentransfer Hamburg</a><a href="https://my-shuttle.eu/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">flughafentransfer</a><?phpbreak;default: ?><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">web sitesia><a href="https://ventusbilisim.com.tr/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">istanbul yazılım firması</a><a href="https://my-shuttle.eu/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">flughafentransfer Munich</a><a href="https://my-shuttle.eu/?ref=3" rel="dofollow" style="position: absolute;font-size:8px;opacity:0.01;filter: alpha(opacity=1);">flughafentransfer</a><?php}} ?>
任何人都可以准确地确定代码中需要更改的内容吗?我不是编码员,这是我为朋友建立的网站。我还是 Wordpress 的新手!
【问题讨论】:
-
Unexpected } 当出现“unexpected }”错误时,您大多过早地关闭了代码块。
-
我仍然不知道我的代码在哪里
-
此代码之前是否包含/需要其他文件? ...因为这可能不是实际的问题区域,这意味着这是解析器对问题所在位置的“最佳猜测”——但真正的麻烦可能在此之前的某个地方。另一种调查方法是对各种文件使用 PHP 的 lint 检查器来查明问题。在命令行使用
php -l file.php,然后用同样的方法查看其他php文件。
标签: wordpress parsing syntax-error