Parse error,T_ENDIF , Help

Discussion in 'PHP' started by sys-tem, Jan 19, 2010.

  1. #1
    Parse error: syntax error, unexpected T_ENDIF in wordpress\wp-content\themes\Gamenow\header.php on line 131

    My header Code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<!-- Title -->
    		<title><?php wp_title('&laquo;', true, 'right'); ?><?php bloginfo('name'); ?></title>
    		
    		<!-- Content Type -->
    		<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    		
    		
    		<!-- Link REL / CSS -->
    		<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
    		<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    		<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
    		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    		
    		<!-- Default Style -->
    <?php if($_COOKIE['style'] == 'style-light') : ?>
    		<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-light.css" />
    <?php else: ?>
    		<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-dark.css" />
    <?php endif; ?>
    		
    		<!-- Light / Dark CSS -->
    		<link rel="alternate stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-light.css" title="style-light" media="screen" />
    		<link rel="alternate stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-dark.css" title="style-dark" media="screen" />
    		
    		<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    		<?php wp_head(); ?>
    		
    		<!-- Javascript -->
    		<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery-1.3.2.min.js"></script>
    		<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/common.js"></script>
    	</head>
    	<body>		
    		<!-- Top -->
    		<a name="top" id="top"></a>
    		<div class="topbg"></div>
    		
    		<!-- Wrapper // -->
    		<div class="wrapper">
    			<!-- Header // -->
    			<div class="header">
    				<!-- Logo -->
    				<h1><a href="<?php echo get_option('home'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/logo-trans.png" alt="GameNow WP Theme" /></a></h1>
    				
    				<!-- Top Links // -->
    				<ul class="toplinks">
    					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/img/icon_rss-trans.png" alt="#" /><a href="<?php bloginfo('rss2_url'); ?>">Subscribe</a></li>
    					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/img/icon_bookmark-trans.png" alt="#" /><a href="javascript:bookmark('<?php echo get_option('home'); ?>','<?php echo str_replace("'","\'",get_bloginfo('name')); ?>');">Bookmark</a></li>
    					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/img/icon_twitter-trans.png" alt="" /><a href="http://www.twitter.com/<?php echo get_wpn_config('twitter_username'); ?>">Twitter</a></li>
    				</ul>
    				<!-- // Top Links -->
    				
    				<!-- Search // -->
    				<div class="search">
    					<form id="searchform" action="<?php echo get_option('home') ?>" />
    						<input type="text" name="s" value="Site Search..." onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
    						<input type="image" src="<?php bloginfo('stylesheet_directory'); ?>/img/spacer.gif" />
    					</form>
    				</div>
    				<!-- // Search -->
    				
    				<!-- Buttons -->
    				<a class="button button-dark styleswitch" rel="style-dark" href="#">Dark</a>
    				<a class="button button-light styleswitch" rel="style-light" href="#">Light</a>
    				
    				<!-- Menu // -->
    				<ul class="menu">
    					<li><a href="<?php echo get_option('home'); ?>">Home</a></li>
    					<?php wp_list_pages('sort_column=menu_order&title_li=&depth=0&include='.get_wpn_config('menu_include').'&exclude_tree='.get_wpn_config('menu_exclude')); ?>
    				</ul>
    				<!-- // Menu -->
    				
    				<!-- Submenu // -->
    				<ul class="submenu">
    					<?php wp_list_categories('sort_column=menu_order&title_li=&depth=0&show_count=0&include='.get_wpn_config('submenu_include').'&exclude='.get_wpn_config('submenu_exclude')); ?>
    				</ul>
    				<!-- // Submenu -->
    			</div>
    			<!-- // Header -->
    			
    			<?php if(is_home() && !get_query_var('paged')) : ?>
    			<!-- Featured / Top Articles // -->
    			<div class="ftop">
    				<div class="featured">
    					<div class="fthumbs">
    						<?php $i = 0; $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>
    						<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="" <?php if($i == 0) echo 'class="active" '; ?>/></a><br />
    						<?php $i++; endwhile; $i = 0; ?>
    					</div>
    					<div class="fwrap">
    						<ul>
    							<?php $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>
    							<li>
    								<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "featured_thumbnail", true); ?>" width="630" height="230" />
    								<div>
    									<a class="title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
    									<?php wpn_content_limit(get_the_content(),90); ?>
    									<a href="<?php the_permalink(); ?>">more</a>
    								</div>
    							</li>
    							<?php endwhile; ?>
    						</ul>
    					</div>
    				</div>
    				<div class="top">
    					<span class="heading1"><span>Top Articles</span></span>
    					<ul>
    					<?php
    						$sql = "
    							SELECT *
    							FROM $wpdb->posts
    							WHERE 	post_date_gmt > ".(time()-strtotime('-2 weeks'))." AND post_type = 'post'
    							ORDER BY comment_count DESC LIMIT 5
    						";
    						
    						$top_posts = $wpdb->get_results($sql);
    
    						foreach ($top_posts as $post)  {
    							?>
    							<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><span><a class="comments" href="<?php the_permalink(); ?>#comments"><?php echo $post->comment_count; ?> Comments</a>Posted Under: <?php the_category(', '); ?></span></li>
    							<?
    						}
    					?>
    					</ul>
    				</div>
    				<div class="clear"></div>
    			</div>
    			<!-- // Featured / Top Articles -->
    			<?php endif; ?>
    			
    			<!-- Content // -->
    			<div class="content">
    				<!--[if lt IE 7]>
    				<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'>
    					<div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div>
    					<div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
    					<div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
    					<div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
    					<div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>You are using an outdated browser</div>
    					<div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>For a better experience using this site, please upgrade to a modern web browser.</div>
    					</div>
    					<div style='width: 75px; float: left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div>
    					<div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div>
    					<div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div>
    					<div style='float: left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div>
    					</div>
    				</div>
    				<![endif]-->
    
    Code (markup):
     
    sys-tem, Jan 19, 2010 IP
  2. WebWorth

    WebWorth Greenhorn

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    20
    #2
    try this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<!-- Title -->
    		<title><?php wp_title('&laquo;', true, 'right'); ?><?php bloginfo('name'); ?></title>
    		
    		<!-- Content Type -->
    		<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    		
    		
    		<!-- Link REL / CSS -->
    		<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
    		<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    		<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
    		<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    		
    		<!-- Default Style -->
    <?php if($_COOKIE['style'] == 'style-light') : ?>
    		<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-light.css" />
    <?php else: ?>
    		<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-dark.css" />
    <?php endif; ?>
    		
    		<!-- Light / Dark CSS -->
    		<link rel="alternate stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-light.css" title="style-light" media="screen" />
    		<link rel="alternate stylesheet" type="text/css" href="<?php bloginfo('stylesheet_directory'); ?>/style-dark.css" title="style-dark" media="screen" />
    		
    		<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    		<?php wp_head(); ?>
    		
    		<!-- Javascript -->
    		<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery-1.3.2.min.js"></script>
    		<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/common.js"></script>
    	</head>
    	<body>		
    		<!-- Top -->
    		<a name="top" id="top"></a>
    		<div class="topbg"></div>
    		
    		<!-- Wrapper // -->
    		<div class="wrapper">
    			<!-- Header // -->
    			<div class="header">
    				<!-- Logo -->
    				<h1><a href="<?php echo get_option('home'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/img/logo-trans.png" alt="GameNow WP Theme" /></a></h1>
    				
    				<!-- Top Links // -->
    				<ul class="toplinks">
    					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/img/icon_rss-trans.png" alt="#" /><a href="<?php bloginfo('rss2_url'); ?>">Subscribe</a></li>
    					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/img/icon_bookmark-trans.png" alt="#" /><a href="javascript:bookmark('<?php echo get_option('home'); ?>','<?php echo str_replace("'","\'",get_bloginfo('name')); ?>');">Bookmark</a></li>
    					<li><img src="<?php bloginfo('stylesheet_directory'); ?>/img/icon_twitter-trans.png" alt="" /><a href="http://www.twitter.com/<?php echo get_wpn_config('twitter_username'); ?>">Twitter</a></li>
    				</ul>
    				<!-- // Top Links -->
    				
    				<!-- Search // -->
    				<div class="search">
    					<form id="searchform" action="<?php echo get_option('home') ?>" />
    						<input type="text" name="s" value="Site Search..." onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
    						<input type="image" src="<?php bloginfo('stylesheet_directory'); ?>/img/spacer.gif" />
    					</form>
    				</div>
    				<!-- // Search -->
    				
    				<!-- Buttons -->
    				<a class="button button-dark styleswitch" rel="style-dark" href="#">Dark</a>
    				<a class="button button-light styleswitch" rel="style-light" href="#">Light</a>
    				
    				<!-- Menu // -->
    				<ul class="menu">
    					<li><a href="<?php echo get_option('home'); ?>">Home</a></li>
    					<?php wp_list_pages('sort_column=menu_order&title_li=&depth=0&include='.get_wpn_config('menu_include').'&exclude_tree='.get_wpn_config('menu_exclude')); ?>
    				</ul>
    				<!-- // Menu -->
    				
    				<!-- Submenu // -->
    				<ul class="submenu">
    					<?php wp_list_categories('sort_column=menu_order&title_li=&depth=0&show_count=0&include='.get_wpn_config('submenu_include').'&exclude='.get_wpn_config('submenu_exclude')); ?>
    				</ul>
    				<!-- // Submenu -->
    			</div>
    			<!-- // Header -->
    			
    			<?php if(is_home() && !get_query_var('paged')) { ?>
    			<!-- Featured / Top Articles // -->
    			<div class="ftop">
    				<div class="featured">
    					<div class="fthumbs">
    						<?php $i = 0; $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>
    						<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="" <?php if($i == 0) {echo 'class="active" ';} ?>/></a><br />
    						<?php $i++; endwhile; $i = 0; ?>
    					</div>
    					<div class="fwrap">
    						<ul>
    							<?php $featured = new WP_Query("cat=".get_wpn_config('featured_category_id')."&showposts=5"); while($featured->have_posts()) : $featured->the_post();?>
    							<li>
    								<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "featured_thumbnail", true); ?>" width="630" height="230" />
    								<div>
    									<a class="title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
    									<?php wpn_content_limit(get_the_content(),90); ?>
    									<a href="<?php the_permalink(); ?>">more</a>
    								</div>
    							</li>
    							<?php endwhile; ?>
    						</ul>
    					</div>
    				</div>
    				<div class="top">
    					<span class="heading1"><span>Top Articles</span></span>
    					<ul>
    					<?php
    						$sql = "
    							SELECT *
    							FROM $wpdb->posts
    							WHERE 	post_date_gmt > ".(time()-strtotime('-2 weeks'))." AND post_type = 'post'
    							ORDER BY comment_count DESC LIMIT 5
    						";
    						
    						$top_posts = $wpdb->get_results($sql);
    
    						foreach ($top_posts as $post)  {
    							?>
    							<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><span><a class="comments" href="<?php the_permalink(); ?>#comments"><?php echo $post->comment_count; ?> Comments</a>Posted Under: <?php the_category(', '); ?></span></li>
    							<?
    						}
    					?>
    					</ul>
    				</div>
    				<div class="clear"></div>
    			</div>
    			<!-- // Featured / Top Articles -->
    			<?php } ?>
    			
    			<!-- Content // -->
    			<div class="content">
    				<!--[if lt IE 7]>
    				<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative;'>
    					<div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display="none"; return false;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div>
    					<div style='width: 640px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'>
    					<div style='width: 75px; float: left;'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-warning.jpg' alt='Warning!'/></div>
    					<div style='width: 275px; float: left; font-family: Arial, sans-serif;'>
    					<div style='font-size: 14px; font-weight: bold; margin-top: 12px;'>You are using an outdated browser</div>
    					<div style='font-size: 12px; margin-top: 6px; line-height: 12px;'>For a better experience using this site, please upgrade to a modern web browser.</div>
    					</div>
    					<div style='width: 75px; float: left;'><a href='http://www.firefox.com' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div>
    					<div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div>
    					<div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div>
    					<div style='float: left;'><a href='http://www.google.com/chrome' target='_blank'><img src='http://www.ie6nomore.com/files/theme/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div>
    					</div>
    				</div>
    				<![endif]-->
    PHP:
     
    WebWorth, Jan 19, 2010 IP
  3. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    theres no need to use "endif" for if statement in PHP
     
    javaongsan, Jan 19, 2010 IP