Title: PHP Syntax Error
Last modified: August 19, 2016

---

# PHP Syntax Error

 *  Resolved [rense](https://wordpress.org/support/users/rense/)
 * (@rense)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-error/)
 * I was hoping if someone could tell me why I am getting this error:
    “Parse error:
   syntax error, unexpected T_VARIABLE in /home/allirens/public_html/testblog/wp-
   content/themes/hacdc/index.php on line 9”
 * I can’t see anything with the syntax that jumps out at me as being wrong. Here
   is my index.php code:
 *     ```
       <?php get_header(); ?>
       <div id="sidebar">
       <?php get_sidebar(); ?>
       </div>
       <div id="entries">
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       <?php the_title(); ?>
       <?php the_content('Continue Reading'); ?>
       Posted on <?php the_time('F jS, Y') ?> by <?php the_author() ?>. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">link</a>.<br />
       Tags: <?php$posttags = get_the_tags();if ($posttags) {foreach($posttags as $tag) {echo $tag->name . ' '; }}?>
       <?php endwhile; else: ?>
       <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
       <?php endif; ?>
       <?php get_footer(); ?>
       ```
   
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-error/#post-749679)
 * This doesn’t look OK:
    `<?php$posttags` shouldn’t there be a space between php
   and the rest?
 *  Thread Starter [rense](https://wordpress.org/support/users/rense/)
 * (@rense)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-error/#post-749828)
 * I’m not sure what was wrong–that could have been it. I just redid the page and
   it’s fine now.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP Syntax Error’ is closed to new replies.

## Tags

 * [index](https://wordpress.org/support/topic-tag/index/)
 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * 2 replies
 * 2 participants
 * Last reply from: [rense](https://wordpress.org/support/users/rense/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/php-syntax-error/#post-749828)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
