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

    Thread Starter launyc

    (@launyc)

    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.