Help please. Website Down, syntax error. Not sure what to do

9 replies
Hi there,

This morning I noticed one of my websites, advancedthermalinc.com started showing an error and will not load.

I can still log into wordpress, but the main website will not load. The error that is showing is below:

Parse error: syntax error, unexpected '<' in /home/jleavitt/public_html/advancedthermalinc.com/wp-content/themes/u-design/header.php on line 232

The weird part is that in the header file there is not a line 232, it ends at 229. I have not made any edits to this website for several months. So I am not sure what happened.

Thank you so much for your time.
#error #syntax #website
  • Profile picture of the author bhartzer
    Take a look at your plugins and start by disabling all of them. See if the site comes back up. Then try to activate one plugin at a time to see which plugin is causing the error.

    9 times out of 10 it's related to the plugins.
    Signature

    Buy or Sell Links Based on Authorship Status at AuthorLinks.net

    {{ DiscussionBoard.errors[8055597].message }}
    • Profile picture of the author jleavitt13
      I have tried disabling all plugins and the error still occurs. I did try switching themes and that did fix it. But the theme I am using is customized, so doing a fresh install of theme would require a bunch of work. So i am hoping to just find the one error spot and fix it.

      Thank you!
      {{ DiscussionBoard.errors[8055655].message }}
  • Profile picture of the author Brandon Tanner
    Originally Posted by jleavitt13 View Post

    Parse error: syntax error, unexpected '<' in /home/jleavitt/public_html/advancedthermalinc.com/wp-content/themes/u-design/header.php on line 232

    The weird part is that in the header file there is not a line 232, it ends at 229. I have not made any edits to this website for several months. So I am not sure what happened.
    The way that PHP counts line numbers is not necessarily the same way that your text editor counts them (one may be set to ignore lines with comments, and the other may not, etc). So sometimes there will be a discrepancy between the two.

    Why don't you post the last 20 or so lines of that page's source code, and we'll see if there are any syntax errors there.
    Signature

    {{ DiscussionBoard.errors[8055744].message }}
    • Profile picture of the author jleavitt13
      Lines 170 through 229


      <div id="page-content-title">
      <div id="page-content-header" class="container_24">
      <div id="page-title">
      <?php $post = $posts[0]; // Hack. Set $post so that the_date() works.
      if (is_page()) : ?>
      <h1><?php the_title(); ?></h1>
      <?php elseif ( is_single() ) : ?>
      <h1><?php the_title(); ?></h1>
      <?php elseif (is_tax()) : /* If this is a taxonomy archive */
      $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>
      <h1 class="pagetitle"><?php echo ucwords( $term->taxonomy ) . ': ' . $term->name; ?></h1>
      <?php elseif (is_category()) : /* If this is a category archive */ ?>
      <?php if ($udesign_options['show_archive_for_string'] == 'yes') : ?>
      <h1 class="pagetitle"><?php single_cat_title("", true); ?></h1>
      <?php else : ?>
      <h1 class="pagetitle"><?php printf( __('Archive for the ‘%s’ Category', 'udesign' ), single_cat_title("", false) ); ?></h1>
      <?php endif; ?>
      <?php elseif (is_search()) : /* If this is a search results page */ ?>
      <h1 class="pagetitle"><?php printf( __('Search Results for ‘<em>%s</em>’', 'udesign' ), get_search_query() ); ?></h1>
      <?php elseif (is_404()) : /* If this is a 404 page */ ?>
      <h1 class="pagetitle"><?php esc_html_e('Page Not Found (Error 404)', 'udesign'); ?></h1>
      <?php elseif( is_tag() ) : /* If this is a tag archive */ ?>
      <h1 class="pagetitle"><?php printf( __('Posts Tagged ‘%s’', 'udesign' ), single_tag_title("", false) ); ?></h1>
      <?php elseif (is_day()) : /* If this is a daily archive */ ?>
      <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_date() ); ?></h1>
      <?php elseif (is_month()) : /* If this is a monthly archive */ ?>
      <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('F Y') ); ?></h1>
      <?php elseif (is_year()) : /* If this is a yearly archive */ ?>
      <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('Y') ); ?></h1>
      <?php elseif (is_author()) : /* If this is an author archive */ ?>
      <h1 class="pagetitle"><?php esc_html_e('Author Archive', 'udesign'); ?></h1>
      <?php elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : /* If this is a paged archive */ ?>
      <h1 class="pagetitle"><?php esc_html_e('Blog Archives', 'udesign'); ?></h1>
      <?php else : // the case when a Title is NOT present the height should be maintained ?>
      <div class="no-title-present"></div>
      <?php endif; ?>
      </div>
      <!-- end page-title -->
      </div>
      <!-- end page-content-header -->
      </div>
      <!-- end page-content-title -->

      <div class="clear"></div>

      <div id="page-content">
      <img src="http://atc.jleavittdesigns.com/wp-content/uploads/2012/11/gg-bttn-over.png" style="display:none;">
      <?php // Breadcrumbs
      if ( ($udesign_options['show_breadcrumbs'] == 'yes') && class_exists('simple_breadcrumb') ) : ?>
      <div class="container_24">
      <?php $breadcrumbs_go = new simple_breadcrumb; ?>
      </div>
      <?php else : ?>
      <div class="no-breadcrumbs-padding"></div>
      <?php endif; ?>



      <?php endif; ?>
      {{ DiscussionBoard.errors[8055764].message }}
      • Profile picture of the author Brandon Tanner
        I don't see any obvious syntax errors in that code. Normally, whenever it says syntax error, unexpected '<' that means that the previous statement is missing a closing semi-colon. But that doesn't seem to be the case in your code (unless I just overlooked something).

        If you haven't changed any code and this just started happening all of a sudden, then it's likely due to either a theme/plugin update, or a PHP version update (either scenario has the potential to break existing code). WordPress is not really my thing though, so it would probably be best to contact the developer of the theme about this.
        Signature

        {{ DiscussionBoard.errors[8055866].message }}
  • Profile picture of the author Altin
    Most probably it is a "extra space" issue. Open /home/jleavitt/public_html/advancedthermalinc.com/wp-content/themes/u-design/functions.php and editi it; remove any extra empty space before and after the code. It happens very often in Wordpress that just an extra empty space at the end or beginning of functions.php file, can mess up your site. Because the extra space might be in functions.php (which loads first), the error might show as in "in header.php" which loads after. Let me know if that helps.
    {{ DiscussionBoard.errors[8061594].message }}
  • Profile picture of the author RobinInTexas
    It might be the lack of a couple of semicolons


    <?php // Breadcrumbs
    if ( ($udesign_options['show_breadcrumbs'] == 'yes') && class_exists('simple_breadcrumb') ) : ?>
    <div class="container_24">
    <?php $breadcrumbs_go = new simple_breadcrumb; ?>
    </div>
    <?php else : ?>


    <?php else ; ?>
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[8062431].message }}
  • Profile picture of the author RobinInTexas
    Learn something new every day.

    How about if you change this line

    <?php else : // the case when a Title is NOT present the height should be maintained ?>

    to

    <?php else : /* the case when a Title is NOT present the height should be maintained*/ ?>
    Signature

    Robin



    ...Even if you're on the right track, you'll get run over if you just set there.
    {{ DiscussionBoard.errors[8063887].message }}

Trending Topics