Unexpected T_ENDIF

Discussion in 'PHP' started by tomcromp, Mar 4, 2008.

  1. #1
    hello im getting this error
    Parse error: syntax error, unexpected T_ENDIF in /home/.puffball/freeshituk/ietv.co.uk/wp-content/themes/bobv2/single-cat-1.php on line 28

    Here is my code
    <?php get_header(); ?>
    <style type="text/css">
    <!--
    body {
    	background-color: #000000;
    }
    .style1 {color: #FFFFFF}
    -->
        </style>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	
    
    		<div id="page">
    	
    			<h2 align="center" class="style1">Your Ad Here</h2>
    		
    			<div class="postentry">
    				<?php the_content(__('Next Page &raquo;')); ?>
    
    </div>
    
    
    			
    		</div>
    
    
    <?php get_header(); ?>
    <style type="text/css">
    <!--
    body {
    	background-color: #000000;
    }
    .style1 {color: #FFFFFF}
    -->
        </style>
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	
    
    		<div id="page">
    	
    			<h2 align="center" class="style1">Your Ad Here</h2>
    		
    			<div class="postentry">
    				<?php the_content(__('Next Page &raquo;')); ?>
    
    </div>
    
    
    			
    		</div>
    
    
    
    	<?php endif; ?>
    
    
    <?php get_footer(); ?>
    PHP:
    If i remove <?php endif; ?> i get this error

    Parse error: syntax error, unexpected $end in /home/.puffball/freeshituk/ietv.co.uk/wp-content/themes/bobv2/single-cat-1.php on line 33

    Please Help

    Cheers
    Tom
     
    tomcromp, Mar 4, 2008 IP
  2. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #2
    Where's your endwhile?
    <?php endwhile; ?> should go before the endif line.
     
    shallowink, Mar 4, 2008 IP
  3. tomcromp

    tomcromp Active Member

    Messages:
    454
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks alot
     
    tomcromp, Mar 4, 2008 IP