Title: If statement template
Last modified: August 20, 2016

---

# If statement template

 *  [liondedan](https://wordpress.org/support/users/liondedan/)
 * (@liondedan)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/if-statement-template/)
 * Hello,
 * I’m looking to place an if statement at the in my headed page that if dosent 
   display the menu on the ‘activities’ template page, this is what I’ve got so 
   far, I think im getting the syntax for the embedded html wrong”
 *     ```
       <?php if (is_php_template($activity)) {
       		}
       	else {
       		<div class="main-nav">	
   
       		<nav id="access" role="navigation">
   
       		wp_nav_menu(array('menu'=> get_post_meta($post->ID, 'menu_name', true) ));
   
       		</nav>
       		</div>
       	}
       	?>
       ```
   
 * Thank you,

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/if-statement-template/#post-3269657)
 * close the php tags before switching to html, and vice-versa.
 * example:
 *     ```
       <?php if (is_php_template($activity)) {
       		}
       	else { ?>
       		<div class="main-nav">	
   
       		<nav id="access" role="navigation">
   
       		<?php wp_nav_menu(array('menu'=> get_post_meta($post->ID, 'menu_name', true) )); ?>
   
       		</nav>
       		</div>
       <?php	}
       	?>
       ```
   
 *  Thread Starter [liondedan](https://wordpress.org/support/users/liondedan/)
 * (@liondedan)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/if-statement-template/#post-3269659)
 * Why don’t I have any logic?
 * Thanks again 🙂

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

The topic ‘If statement template’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [liondedan](https://wordpress.org/support/users/liondedan/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/if-statement-template/#post-3269659)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
