• Hello guys i just edited out a some lines on code, the page results keeps giving me:

    Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/n/mensah/html/bestpricegh/wp-content/themes/kassyopea/wpsc-single_product.php on line 54
    THIS IS THE CODE

    while ( wpsc_have_products() ) : wpsc_the_product(); ?>
    
    						<div class="textcol">	
    
    										<?php
    										if ( function_exists( 'gold_shpcrt_display_gallery' ) ) :
    											echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
    
    											if ( get_option( 'show_gallery' ) ) :
    											?>
    											<style type="text/css">
    	.wpcart_gallery img {

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin]

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

    (@wordpressismypuppet)

    If this is all the code for the page, it’s really messed up 🙂 You are getting that error message, in this case, because you have two if statements, one right after the other, without either ending the first if, or putting an else. You have:

    <?php
    	if ( function_exists( 'gold_shpcrt_display_gallery' ) ) :
    		echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
    	if ( get_option( 'show_gallery' ) ) :
    ?>

    When it should be something more like:

    <?php
    	if ( function_exists( 'gold_shpcrt_display_gallery' ) ) :
    		echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
    	endif;
    	if ( get_option( 'show_gallery' ) ) :
    ?>

    Or if you need an else for whatever reason:

    <?php
    	if ( function_exists( 'gold_shpcrt_display_gallery' ) ) :
    		echo gold_shpcrt_display_gallery( wpsc_the_product_id() );
    	else if ( get_option( 'show_gallery' ) ) :
    ?>

    If, Else, While and other conditional comments need to be closed. If you use : to start them, you need endif; or endwhile;. If you use open curly brackets { you need to close the curly bracket }

    wpismypuppet

    (@wordpressismypuppet)

    Keep in mind you might be closing them further down the page, but this is the only code you gave us, so it’s what we have to work with… if you want to paste all the code for the entire page, I could give you better results.

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

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