0

I'm using a demo theme from here

I installed the BeTheme on Wordpress using FlyWheel. I installed/activated the plugins, then activated the demo and chose the Gym theme. After which I received the following error:

Parse error: syntax error, unexpected '}' in C:\Users\Inspiron 14 5000\Local Sites\coastal-hideaways\app\public\wp-content\themes\betheme\header.php on line 57

Below is the code on line 57 on header.php

<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}} ?>

Can anyone identify exactly what in the code needs to be changed? I'm not a coder and this is a site I'm setting up for a friend. I'm still a newbie with Wordpress!

4
  • 1
    Does this answer your question? PHP parse/syntax errors; and how to solve them Commented Jan 4, 2020 at 23:59
  • Unexpected } When getting an "unexpected }" error, you've mostly closed a code block too early. Commented Jan 5, 2020 at 0:35
  • I still don't know where in my code that is Commented Jan 5, 2020 at 0:35
  • Are other files included/required before this code? ... because this may not be the actual problem area, which means that this is the parser's "best guess" of where the problem may be -- but the real trouble may be somewhere before this point. Another way to investigate is to use PHP's lint checker on the various files to pinpoint the trouble. Use php -l file.php at the command line, and then check other php files the same way. Commented Jan 5, 2020 at 0:56

2 Answers 2

2

You have errors in your code. Simple way usually to find out what the issue is is to brake the code and format it properly. Please try using the following edited code and let me know if you have any further errors.

<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>

<?php break;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>

<?php break;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>

<?php break;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>
    <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 ?>

The errors I've noticed were in your break's, one forgotten </a> and strange php closing with double }} Hope this helps with your issue.

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same problem. Solution is to fix the missing/incomplete </a> tag:

<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>

And to fix the tag with the }} :

<?php}} ?>

to

<?php }} ?>

Regards.

Ray.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.