Title: PHP Help please!
Last modified: August 19, 2016

---

# PHP Help please!

 *  [rtforeman](https://wordpress.org/support/users/rtforeman/)
 * (@rtforeman)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/php-help-please-3/)
 * Hi,
 *  Trying to combine a couple snippets of code and it breaks the page – see below.
   How can I make that work?
 *  I’m pathetic with PHP so any help would be appreciated.
 *  Thanks!
 *     ```
       <?php if ( is_user_logged_in() ) { //This Breaks the page <?php $teaser = get_post_meta($post->ID, 'teaser-video', true); if ($teaser) {?>
           Teaser Logged In
           <?php } else { ?>
           No Teaser Logged In
           <?php } ?>
   
           } else {
   
           echo 'Not Logged In';
   
           };
   
           ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [jon](https://wordpress.org/support/users/adiant/)
 * (@adiant)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/php-help-please-3/#post-1713385)
 * `<?php if ( is_user_logged_in() ) { //This Breaks the page <?php`
    You are “going
   into php mode” again when you are already in php mode. Remove the second `<?php`
 * Likewise `<?php } ?> } else {`
    is a problem as you get out of php with the `?
   >` and then follow with the `} else {` php construct.
 * It takes some getting used to, but all the php info one would ever need is here:
   [http://ca.php.net/manual/en/index.php](http://ca.php.net/manual/en/index.php)

Viewing 1 replies (of 1 total)

The topic ‘PHP Help please!’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [jon](https://wordpress.org/support/users/adiant/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/php-help-please-3/#post-1713385)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
