Support » Fixing WordPress » Parse error: syntax error, unexpected $end

  • Could someone please help me with the syntax?

    I want to display a secure header on one page (‘apply’)

    Where am I going wrong (this is in my header.php file):

    <body class="custom">
    <div id="wrap">
        <div id="top">
        	<div class="content">
    
                <div id="header">
    
    <?php if (is_page('apply')) { ?>
    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img class="logo" src="https://www.yourvancouvermortgagebroker.ca/wp-content/woo_uploads/120-107-logo.png") alt="<?php bloginfo('name'); ?>" /></a>
                    <h1>{ ?><?php bloginfo('name'); ?></h1>
    
    <?php } else { ?>
    
                    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img class="logo" src="<?php if ( get_option('woo_logo') <> "" ) { echo get_option('woo_logo').'"'; } else { bloginfo('template_directory'); ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?>" /></a>
                    <h1>{ ?><?php bloginfo('name'); ?></h1>
    
                </div>
            </div>
        </div>

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • You had several syntax errors:

    <body class="custom">
    <div id="wrap">
       <div id="top">
          <div class="content">
    
             <div id="header">
    
                <?php  if (is_page('apply')) { ?>
                    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img class="logo" src="https://www.yourvancouvermortgagebroker.ca/wp-content/woo_uploads/120-107-logo.png") alt="<?php bloginfo('name'); ?>" /></a>
                    <h1><?php bloginfo('name'); ?></h1>
    
                <?php } else { ?>
    
                    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img class="logo" src="<?php if ( get_option('woo_logo') <> "" ) { echo get_option('woo_logo').'"'; } else { bloginfo('template_directory'); } ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?>" /></a>
                    <h1><?php bloginfo('name'); ?></h1>
                <?php} ?>
                </div>
            </div>
        </div>

    Hey thanks for the response. I tried posting the following code and it has returned this error:

    Parse error: syntax error, unexpected ‘}’ in /home1/awkwardi/public_html/wp-content/themes/coffeebreak/header.php on line 80

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
    <meta name="google-site-verification" content="G_cMZztQAOGT7HzghOXlxnfXbsrEpZxOT-V9vq1-bBY" />
    
    <title>
    <?php if ( is_home() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php bloginfo('description'); ?><?php } ?>
    <?php if ( is_search() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Search Results<?php } ?>
    <?php if ( is_author() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Author Archives<?php } ?>
    <?php if ( is_single() ) { ?><?php wp_title(''); ?>&nbsp;|&nbsp;<?php bloginfo('name'); ?><?php } ?>
    <?php if ( is_page() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;<?php wp_title(''); ?><?php } ?>
    <?php if ( is_category() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Archive&nbsp;|&nbsp;<?php single_cat_title(); ?><?php } ?>
    <?php if ( is_month() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Archive&nbsp;|&nbsp;<?php the_time('F'); ?><?php } ?>
    <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php bloginfo('name'); ?>&nbsp;|&nbsp;Tag Archive&nbsp;|&nbsp;<?php  single_tag_title("", true); } } ?>
    </title>
    
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php if ( get_option('woo_feedburner_url') <> "" ) { echo get_option('woo_feedburner_url'); } else { echo get_bloginfo_rss('rss2_url'); } ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <!--[if IE 6]>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/js/pngfix.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/includes/js/menu.js"></script>
    <![endif]-->	
    
    <?php if (is_home()) wp_head(); ?>
    <?php if ( is_single() ) wp_enqueue_script( 'comment-reply' ); ?>
    
    <?php if (is_home()) { ?>
    <script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery("#loopedSlider").loopedSlider({
    <?php
    	$autoStart = 0;
    	$slidespeed = 600;
    	$slidespeed = get_option("woo_slider_speed") * 1000;
    	if ( get_option("woo_slider_auto") == "true" )
    	   $autoStart = get_option("woo_slider_interval") * 1000;
    	else
    	   $autoStart = 0;
     ?>
            autoStart: <?php echo $autoStart; ?>,
            slidespeed: <?php echo $slidespeed; ?>,
            autoHeight: true
        });
    });
    </script>
    
    <?php } ?>
    
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-16866387-7']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    
    </head>
    <body class="custom">
    <div id="wrap">
       <div id="top">
          <div class="content">
    
             <div id="header">
    
                <?php  if (is_page('apply')) { ?>
                    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img class="logo" src="https://www.yourvancouvermortgagebroker.ca/wp-content/woo_uploads/120-107-logo.png") alt="<?php bloginfo('name'); ?>" /></a>
                    <h1><?php bloginfo('name'); ?></h1>
    
                <?php } else { ?>
    
                    <a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><img class="logo" src="<?php if ( get_option('woo_logo') <> "" ) { echo get_option('woo_logo').'"'; } else { bloginfo('template_directory'); } ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?>" /></a>
                    <h1><?php bloginfo('name'); ?></h1>
                <?php} ?>
                </div>
            </div>
        </div>

    Thanks I’m a total noob with this stuff

    nvm it’s working… just installed a plugin! weee

    Can someone take a look at my title code.Its seem to be something wrong
    <title>
    <?php if ( is_home() ) { ?><?php bloginfo(‘name’); ?> | <?php bloginfo(‘description’); ?><?php } ?>
    <?php if ( is_search() ) { ?><?php bloginfo(‘name’); ?> | Search Results<?php } ?>
    <?php if ( is_author() ) { ?><?php bloginfo(‘name’); ?> | Author Archives<?php } ?>
    <?php if ( is_single() ) { ?>Watch Online<?php wp_title(”); ?> Megavideo Streaming | <?php bloginfo(‘name’); ?><?php } ?>
    <?php if ( is_page() ) { ?><?php bloginfo(‘name’); ?> | <?php wp_title(”); ?><?php } ?>
    <?php if ( is_category() ) { ?>Watch Online<?php single_cat_title(); ?> Megavideo Online Streaming | <?php bloginfo(‘name’); ?><?php } ?>
    <?php if ( is_month() ) { ?><?php bloginfo(‘name’); ?> | Archive | <?php the_time(‘F’); ?><?php } ?>
    <?php if ( is_year() ) { ?><?php bloginfo(‘name’); ?> | Archive | <?php the_time(‘F’); ?><?php } ?>
    <?php if (function_exists(‘is_tag’)) { if ( is_tag() ) { ?><?php bloginfo(‘name’); ?> | Tag Archive | <?php single_tag_title(“”, true); } } ?>
    </title>

    @newbesy,
    Open your own topic, add only small bits of code inside ticks ` (under the Esc key), for larger code blocks use http://pastebin.com and post the link in your topic.

    Pastebin is preferred as the sytax is highlighted and easy to read.

    The code above looks fine, so more detail is required as to what the problem is and a link to the website if it only affects one file type.

    David

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Parse error: syntax error, unexpected $end’ is closed to new replies.