Mike V
Mike V

Reputation: 11

Parse error: syntax error, unexpected '}' in header.php on line 57

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!

Upvotes: 0

Views: 868

Answers (2)

Raynet
Raynet

Reputation: 69

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.

Upvotes: 0

h3k
h3k

Reputation: 196

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.

Upvotes: 2

Related Questions