Q:

Troubleshooting "syntax error, unexpected T_ELSE" in Wordpress template

I'm trying to create an "if" statement in PHP that prevents a single post in Wordpress from displaying on a certain page. The page I would like the post removed from is located here:
http://www.insyteja.com/news-and-events/
The post I want removed is "Homepage Event Info Section".
The reason I want it removed is because I want the post contents to only be shown on the "Upcoming Events" section on the homepage, not the page shown.  
Here is the area of code that I'm having problems with:
<?php
/*
Template Name: UPCOMING EVENTS
*/
?>

<div id="content">

<div id="body">

<div id="body_left">

<?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

        <div class="post" id="post-<?php the_ID(); ?>">

            <h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            <div class="postmetadata" style="font-size:11px; margin-bottom:15px;"><?php the_time(get_option('date_format').', '.get_option('time_format')) ?> <!-- <?php _e('by') ?> <?php the_author() ?> --></div>
            <div class="postentry">
                <?php the_content(__('Continue reading'). " &#8216;" . the_title('', '', false) . "&#8217; &raquo;"); ?>
            </div>

            <div class="postmetadata">
                <?php if( function_exists('the_tags') ) 
                    the_tags(__('Tags: '), ', ', '<br />'); 
                ?>
                <?php _e('Category:') ?> <?php the_category(', ') ?>&nbsp;&nbsp;|&nbsp;
                <?php comments_popup_link(__('Comment'), __('1 Comment'), __('% Comments')); ?>
                <?php edit_post_link(__('Edit'), '&nbsp;|&nbsp;&nbsp;', ''); ?>
             </div>

        </div>

    <?php endwhile; ?>

    <div class="navigation">
        <div class="alignleft"><?php next_posts_link(__('&laquo; Previous Entries')) ?></div>
        <div class="alignright"><?php previous_posts_link(__('Next Entries &raquo;')) ?></div>
    </div>

<?php else : ?>
    <div class="post">
        <h2 class="posttitle"><?php _e('Not Found') ?></h2>
        <div class="postentry"><p><?php _e('Sorry, no posts matched your criteria.'); ?></p></div>
    </div>

<?php endif; ?>
</div>

<div id="body_right">
    <?php get_sidebar(); ?>
</div>

</div>
</div>

The page gets an error saying this:

Parse error: syntax error, unexpected T_ELSE in /data/10/0/134/72/949887/user/980241/htdocs/wp-content/themes/instyle/events.php on line 27

Syntax is usually always my issue, any help would be appreciated.

A:

After your Hello World, you're missing a }:
                               <?php if (the_category == 'Upcoming Event')  {?>
                              <div>Hello World!</div>
                                 <?php } else { ?>
                                       ^-- here

since you've opened a { on the if() line, you must close it before moving on to the else.

