Please help with this Serious Problem on my wordpress blog

by Giggle
13 replies
hi All:

I am getting the following error on most of my wordpress blogs when i click on a post

Parse error: syntax error, unexpected T_ENDWHILE in /home/plaw193/public_html/COOL-TATTOO-DESIGNS.NET/wp-content/themes/lifestyle_20/index.php on line 12



How can i solve this problem
#blog #problem #serious #wordpress
  • Profile picture of the author John Ayling
    Might be a good idea to check the file last modified date in an FTP program.
    If it is very recent, then your site may have been hacked.

    First thing is to look at the error and download that offending file and see what the trouble is.
    Signature
    Software Marketing & Licensing System for WordPress Plugins, Themes & .NET Software
    >> 72 Hour Special <<
    {{ DiscussionBoard.errors[6591734].message }}
  • Profile picture of the author sirishainc
    Do you have a recent backup of your site from before the error started occuring? Backup of program code as well as database?
    {{ DiscussionBoard.errors[6592170].message }}
    • Profile picture of the author sirishainc
      If you want to pm me with a copy of your index.php file I'd be glad to take a look at it and see if I can spot anything
      {{ DiscussionBoard.errors[6592185].message }}
    • Profile picture of the author Giggle
      I know that all the websites were hacked and hostgator brought this to my attention. However
      this happened earlier this year. i only knew this specific problem existed today when i tried to change a blog post. The blogs look normal in all respects
      {{ DiscussionBoard.errors[6592204].message }}
      • Profile picture of the author sirishainc
        It's kind of difficult to provide a fix without doing a bit of debugging. I do IT work for a living and have web development company. If you don't find a solution to your problem feel free to contact me...my website is sghostwrx.com. I'd be glad to give you a hand but it would probably require me to log into your site..not sure if you want a complete stranger doing that.

        I can give you some tips on database and program code backup programs and strategies (all Opensource ie. no charge for the programs) if you could use it.

        Good Luck!

        Shane
        {{ DiscussionBoard.errors[6592352].message }}
  • Profile picture of the author teguhyuliantos
    These error often accour in your hosting panel. You can deleted some plugin or theme that maybe just installed. But before delete, you can backup your data in your PC.
    {{ DiscussionBoard.errors[6593102].message }}
  • Profile picture of the author Power Solutions
    Were you messing around in cPanel with PHP settings? Here's a link to check out: http://url.ejo.im/?i=9

    Basically that error seems to show up mostly when you use short open tags. <? instead of <?php
    Signature
    -=: Internet Marketing News :=------=: Resources I Use :=------=: Prime Ad Network :=------=: ?Profit? :=-
    {{ DiscussionBoard.errors[6593430].message }}
  • {{ DiscussionBoard.errors[6594264].message }}
  • Profile picture of the author CodeShack
    Your site seems to be running ok - The source shows no sign of malicious code.
    That is from viewing the main url - Category, Tag and date viewing are good too.

    I'd suggest that the index.php may be damaged, calling the index.php from your theme folder gives the same error.

    I do have the same theme, so have a clean copy of it to compare or work from.
    It's up to you, it takes trust I know, but if you want, I'm happy to help.
    I probably wouldn't need any ftp access, just an admin access as the viewing and repairing should be do-able via the WP editor.
    To do this, if it was me in your shoes, I'd either change the password and share the admin login or create another admin account - you can then change the pw back or delete the extra account after the fix.

    Let me know what you think, I'm happy to help, I hate malicious shares/hacks etc so always on the lookout to help and clean.

    Cheers,
    {{ DiscussionBoard.errors[6594870].message }}
  • Profile picture of the author Workman
    Could you share what's on line 12 of that file?

    It's griping about something that shouldn't be on that line.
    {{ DiscussionBoard.errors[6595598].message }}
  • Profile picture of the author Giggle
    below is the code that i took from the blog, not sure what line is line 12

    <?php ?>
    <?php?><div style="clear:both;"></div>

    <div class="postmeta">
    <p><span class="tags">Tags: <?php the_tags('') ?></span></p>
    </div>

    <!--
    <?php trackback_rdf(); ?>
    -->

    <?php endwhile; else: ?>

    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

    </div>

    <div class="adsense-post">

    <!--To activate your Google AdSense ad, go to your WP dashboard and go to Appearance -> Revolution Lifestyle Options and enter your Google Adsense Code.-->

    <?php $adsense_468 = get_option('revlifestyle_adsense_468'); echo stripslashes($adsense_468); ?>

    </div>

    <div class="comments">

    <?php comments_template('',true); ?>

    </div>

    </div>

    <?php include(TEMPLATEPATH."/sidebar.php");?>

    </div>

    <!-- The main column ends -->

    <?php get_footer(); ?>
    {{ DiscussionBoard.errors[6597466].message }}
    • Profile picture of the author SmartWeb
      Originally Posted by Giggle View Post

      below is the code that i took from the blog, not sure what line is line 12

      <?php ?>
      <?php?><div style="clear:both;"></div>

      <div class="postmeta">
      <p><span class="tags">Tags: <?php the_tags('') ?></span></p>
      </div>

      <!--
      <?php trackback_rdf(); ?>
      -->

      <?php endwhile; else: ?>

      <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

      </div>

      <div class="adsense-post">

      <!--To activate your Google AdSense ad, go to your WP dashboard and go to Appearance -> Revolution Lifestyle Options and enter your Google Adsense Code.-->

      <?php = get_option('revlifestyle_adsense_468'); echo stripslashes(); ?>

      </div>

      <div class="comments">

      <?php comments_template('',true); ?>

      </div>

      </div>

      <?php include(TEMPLATEPATH."/sidebar.php");?>

      </div>

      <!-- The main column ends -->

      <?php get_footer(); ?>
      If you see the code you posted,
      on line 12 there is "endwhile;" , so its a PHP command to end the "while" loop.

      and this is the same error you are geting
      Parse error: syntax error, unexpected T_ENDWHILE in /home/plaw193/public_html/COOL-TATTOO-DESIGNS.NET/wp-content/themes/lifestyle_20/index.php on line 12
      what i feel from code you pasted, that this code is not full, it is cut from top, as you can see the start of while loop is not there.

      if you need to fix it faster, you need to send the entire theme, all file, you may download that using your hosting cpanel, and sent it over to any tech guy, or to me.

      it doesn't seems to be a big issue, but since there are no files present here by you, we can't help much.
      {{ DiscussionBoard.errors[6601513].message }}
  • Profile picture of the author CodeShack
    I agree totally with SmartWeb - the code above is not complete or has been edited and broken.

    Same offer/suggestion as SmartWeb - if you can share the file, it can be fixed by one of us here.

    Ideally, grab the whole theme folder and zip it up, pop it on a share site and give us the link.

    The other option - here is a clean version of the index.php from that theme.
    You can see that a chunk of code is missing from your version above. (you can see that the start of the 'if' is there)
    Also your code is missing the get_header call and much more needed stuff
    Perhaps try replacing your version with this?
    (I removed empty lines to compact it a little)
    Code:
    <?php get_header(); ?>
    <div id="content">
        <div id="contentleft">
            <div class="postarea">
            <?php include(TEMPLATEPATH."/breadcrumb.php");?>
                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                <h1><?php the_title(); ?></h1>
                <div class="date">
                    <div class="dateleft">
                        <p><span class="time"><?php the_time('F j, Y'); ?></span> by <?php the_author_posts_link(); ?> &nbsp;<?php edit_post_link('(Edit)', '', ''); ?> <br /> Filed under <?php the_category(', ') ?></p> 
                    </div>
                    <div class="dateright">
                        <p><span class="icomment"><a href="<?php the_permalink(); ?>#respond"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a></span></p> 
                    </div>
                </div>
                <div style="clear:both;"></div>
                <?php the_content(__('Read more'));?><div style="clear:both;"></div>
                <div class="postmeta">
                    <p><span class="tags">Tags: <?php the_tags('') ?></span></p>
                </div>
                <!--
                <?php trackback_rdf(); ?>
                -->
                <?php endwhile; else: ?>
                <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
            </div>
            <div class="adsense-post">
                <!--To activate your Google AdSense ad, go to your WP dashboard and go to Appearance -> Revolution Lifestyle Options and enter your Google Adsense Code.-->
                <?php  = get_option('revlifestyle_adsense_468'); echo stripslashes(); ?>
            </div>
            <div class="comments">
                <?php comments_template('',true); ?>
            </div>
        </div>
    <?php include(TEMPLATEPATH."/sidebar.php");?>
    </div>
    <!-- The main column ends  -->
    <?php get_footer(); ?>
    Cheers,
    {{ DiscussionBoard.errors[6604014].message }}

Trending Topics