1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help , get this Parse error,T_ENDIF ....

Discussion in 'PHP' started by Nemanja007, Oct 1, 2009.

  1. #1
    When i tryed to change theme to my blog, I got this error :
    Parse error: syntax error, unexpected T_ENDIF in G:\Program Files\xampp\htdocs\wordpress\wp-content\themes\Gamenow\header.php on line 131


    <!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]-->
    
    PHP:
    Please help me ! THX
     
    Nemanja007, Oct 1, 2009 IP
  2. jimdickens

    jimdickens Guest

    Messages:
    14
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php if(is_home() && !get_query_var('paged')) : ?>

    I think this line should be

    <?php if(is_home() && !get_query_var('paged')) { ?>


    and then replace the endif with a }


    IF statements open and close with "{" and "}"

    ENDIF looks like VB
     
    jimdickens, Oct 2, 2009 IP
  3. caprichoso

    caprichoso Well-Known Member

    Messages:
    433
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #3
    hmmm, that wont work. It looks like a smarty template or something. That's no a pure PHP and the problem seems to be that you copied part of the template leaving a mandatory portion out.
     
    caprichoso, Oct 3, 2009 IP
  4. lmao

    lmao Guest

    Messages:
    93
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    it is just that short open tag are not supported on ur server i think that is why it is not considering any code written between <? ?> tag i just relaced <? with <?php

    use this code
     
    lmao, Oct 3, 2009 IP
  5. Nemanja007

    Nemanja007 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    God bess you ! :D Thank you very much .... It works now :D YAAY ThX one more time m8 , really .
     
    Nemanja007, Oct 3, 2009 IP