Title: PHP nesting problem
Last modified: August 19, 2016

---

# PHP nesting problem

 *  [bsd13](https://wordpress.org/support/users/bsd13/)
 * (@bsd13)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/php-nesting-problem/)
 * I hope this is the right section. I’m trying to do
 *     ```
       <?php
         if(is_page()); {
       <h1><?php the_title(); ?></h1>
       }  else {
       <h1>Text HERE</h1>
       }
       ```
   
 * But it keeps giving me an “unexpected < at…” error. What am I doing wrong?
 * Thanks!

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

 *  [tugbucket](https://wordpress.org/support/users/tugbucket/)
 * (@tugbucket)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/php-nesting-problem/#post-1009645)
 * <?php if(is_page()); { ?>
    <h1><?php the_title(); ?></h1> <?php } else { ?> <
   h1>Text HERE</h1> <?php } ?>
 *  Thread Starter [bsd13](https://wordpress.org/support/users/bsd13/)
 * (@bsd13)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/php-nesting-problem/#post-1009769)
 * Thanks for replying but didn’t work. Now I’m getting “Parse error: syntax error,
   unexpected T_ELSE” I can make the is_page(); function just fine, but as soon 
   as I go beyond that I run into errors.
 *  [davesgonebananas](https://wordpress.org/support/users/davesgonebananas/)
 * (@davesgonebananas)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/php-nesting-problem/#post-1009770)
 * `if(is_page()); {`
 * remove the ;

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

The topic ‘PHP nesting problem’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [davesgonebananas](https://wordpress.org/support/users/davesgonebananas/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/php-nesting-problem/#post-1009770)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
