Title: Parse error: syntax error, unexpected T_ELSE
Last modified: August 21, 2016

---

# Parse error: syntax error, unexpected T_ELSE

 *  [launyc](https://wordpress.org/support/users/launyc/)
 * (@launyc)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else-8/)
 * To start I am a newbie! Simply trying to just create a nice little website for
   myself.
 * I am using the Analytical Lite Theme and trying to incorporate Woocommerce. They
   are not compatible so as per the WooThemes page, I have duplicated the page.php
   file, renamed it woocommerce.php. Then I replace the theme’s loop with Woocommerce’s
   loop. That is when I get this error:
 * > Parse error: syntax error, unexpected T_ELSE in /*****************************/
   > analytical-lite/woocommerce.php on line 18
 * This is my woocommerce.php AFTER i deleted the loop and added woocommerce’s loop.
 *     ```
       <?php get_header(); global $themename; global $shortname; ?>
       <!-- #Container Area -->
       <div id="container" class="clearfix">
       	<div class="clearfix">
       		<!-- .content_wrap -->
       		<div class="content_wrap">
       			<!-- #Content -->
       			<div id="content">
       				<?php woocommerce_content(); ?>
       				<!-- Pagination -->
       				<div class="pagination clearfix">
       					<?php if(function_exists('ana_pagenavi') && sketch_get_option($shortname.'_show_pagenavi')) { ana_pagenavi();} else { ?>
       							<div class="alignleft"><?php previous_posts_link('&larr;Previous') ?></div>
       							<div class="alignright"><?php next_posts_link('Next&rarr;','') ?></div>
       					<?php } ?>
       				</div>
       				<!-- Pagination -->
       				<?php else : ?>
       				<div class="post"><h2><?php _e('Not Found','analytical'); ?></h2></div>
       				<?php endif; ?>
       			</div>
       			<!-- #Content --->
       		</div>
       		<!-- .content_wrap -->
           </div>
       </div>
       <!-- #Container Area -->
       <?php get_footer(); ?>
       ```
   
 * Please Help!
    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else-8/#post-4514879)
 * You have an if/else/endif statement is incomplete. You have no beginning `if`
   for this block:
 *     ```
       <?php else : ?>
       <div class="post"><h2><?php _e('Not Found','analytical'); ?></h2></div>
       <?php endif; ?>
       ```
   
 * The error notice is pointing you to this line. I would remove:
 * `<?php else : ?>`
 * and
 * `<?php endif; ?>`
 * Would be worth reading this too: [http://www.w3schools.com/php/php_if_else.asp](http://www.w3schools.com/php/php_if_else.asp)
 *  Thread Starter [launyc](https://wordpress.org/support/users/launyc/)
 * (@launyc)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else-8/#post-4514934)
 * That did the trick! I’ve spent days trying to figure it out! Thanks so much Scott!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Parse error: syntax error, unexpected T_ELSE’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [launyc](https://wordpress.org/support/users/launyc/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_else-8/#post-4514934)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
