WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am try to show different menus for login and logout user. Here is perfect solution to do this and also work on Twenty eleven theme. But when I try to add this code to my woo theme's defination (in header.php) I got this error Parse error: syntax error, unexpected '}' in C:\xampp-portable\htdocs\wordpress\wp-content\themes\definition\header.php on line 63 How to fix it?

This is code of Definition's header.php:

if ( ! defined( 'ABSPATH' ) ) exit;
 * Header Template
 * Here we setup all logic and XHTML that is required for the header section of all screens.
 * @package WooFramework
 * @subpackage Template

 global $woo_options, $woocommerce;

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php woo_title( '' ); ?></title>
<?php woo_meta(); ?>
<link rel="pingback" href="<?php echo esc_url( get_bloginfo( 'pingback_url' ) ); ?>" />

<body <?php body_class(); ?>>
<?php woo_top(); ?>

<div id="wrapper">

    <?php woo_header_before(); ?>

    <header id="header">
        <div class="col-full">

            <?php woo_header_inside(); ?>

                <span class="nav-toggle"><a href="#navigation"><span><?php _e( 'Navigation', 'woothemes' ); ?></span></a></span>
                <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
                <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>

            <?php woo_nav_before(); ?>

            <nav id="navigation" class="col-full" role="navigation">

                <?php /*
                if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'primary-menu' ) ) {
                    wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav fl', 'theme_location' => 'primary-menu' ) );
                } else { */
                if (is_user_logged_in()) {
      wp_nav_menu(array('theme_location' => 'logged_user' ));
} else {
      wp_nav_menu(array('theme_location' => 'new_user' ));
                <ul id="main-nav" class="nav fl">
                    <?php if ( is_page() ) $highlight = 'page_item'; else $highlight = 'page_item current_page_item'; ?>
                    <li class="<?php echo $highlight; ?>"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Home', 'woothemes' ); ?></a></li>
                    <?php wp_list_pages( 'sort_column=menu_order&depth=6&title_li=&exclude=' ); ?>
                </ul><!-- /#nav -->
                <?php } ?>
                <?php if ( is_woocommerce_activated() && isset( $woo_options['woocommerce_header_cart_link'] ) && 'true' == $woo_options['woocommerce_header_cart_link'] ) { ?>
                    <ul class="nav cart fr">
                        <li><a class="cart-contents" href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php esc_attr_e( 'View your shopping cart', 'woothemes' ); ?>"><?php echo sprintf( _n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes' ), $woocommerce->cart->cart_contents_count );?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a></li>
                <?php } ?>

            </nav><!-- /#navigation -->

            <?php woo_nav_after(); ?>

        </div><!-- /.col-full -->
    </header><!-- /#header -->

    <?php woo_content_before(); ?>
share|improve this question

closed as too localized by Michael, anu, toscho May 1 '13 at 11:41

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Moderator, please fix code view – John Doe May 1 '13 at 7:50
At your service. :) Please read our fantastic editing help. – toscho May 1 '13 at 9:34
up vote 0 down vote accepted

I placed your code in a line number editor to find line 63. I have marked the line with the extra } (well it's in line 64 in my editor)

enter image description here

This is a PHP error you got. Try to remove this line.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.