Title: Help with if statement
Last modified: August 21, 2016

---

# Help with if statement

 *  [heisdnice](https://wordpress.org/support/users/heisdnice/)
 * (@heisdnice)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/help-with-if-statement/)
 * ok so im editing a single theme file to have it so if the page number is one 
   specific number, it will post a div, but if its any other page it wont post anything.
 * here is my coding:
 *     ```
       <?php  if ( is_page('297'))  {
           echo '<div class="content-block widget nopadding">
       <div class="block-title">
       <span>Beat Store</span>
       </div>
       <div class="beatstore ">
       <object type='application/x-shockwave-flash' height='385' width='610' data='http://www.myflashstore.net/widgets/flash/soundstore.swf?user_id=49626'  allowscriptaccess='always'>
       <param name='movie' value='http://www.myflashstore.net/widgets/flash/soundstore.swf?user_id=49626' />
       <param name='menu' value='false' />
       <param name='wmode' value='transparent' />
       <param name='allowscriptaccess' value='always' />
       <param name='flashvars' value='autoplay=0&' />
       </object>
       </div>
       </div>';
       ?>
       ```
   
 * but im getting the error:
 * `Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'`

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

 *  [Scott (@scottsweb)](https://wordpress.org/support/users/scottsweb/)
 * (@scottsweb)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/help-with-if-statement/#post-4657418)
 * Give this a go:
 *     ```
       <?php  if ( is_page('297') )  { ?>
   
       <div class="content-block widget nopadding">
       <div class="block-title">
           <span>Beat Store</span>
       </div>
       <div class="beatstore">
       <object type='application/x-shockwave-flash' height='385' width='610' data='http://www.myflashstore.net/widgets/flash/soundstore.swf?user_id=49626'  allowscriptaccess='always'>
       <param name='movie' value='http://www.myflashstore.net/widgets/flash/soundstore.swf?user_id=49626' />
       <param name='menu' value='false' />
       <param name='wmode' value='transparent' />
       <param name='allowscriptaccess' value='always' />
       <param name='flashvars' value='autoplay=0&' />
       </object>
       </div>
       </div>
   
       <?php } ?>
       ```
   
 *  Thread Starter [heisdnice](https://wordpress.org/support/users/heisdnice/)
 * (@heisdnice)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/help-with-if-statement/#post-4657440)
 * i tried it, no more error but the div isnt displaying.
 * currently the way my theme is setup it puts my artists in an artists section.
   
   so the URL would be:
 * `www.mysitehere.com/artists/pagetitlehere`
 * i have determined that the post ID for my specific page is 297 because when i
   go to edit the page the URL says:
 * `wp-admin/post.php?post=297&action=edit`
 * is this correct and could the theme be conflicting with this?
 * by the way im using this theme:
 * `http://themeforest.net/item/replay-responsive-music-wordpress-theme/3172436`
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/help-with-if-statement/#post-4657443)
 * I’m sorry but as you appear to be using a commercial theme, you need to seek 
   support from the theme’s developer/vendor. We do not support [commercial products](http://codex.wordpress.org/Forum_Welcome#Commercial_Products)
   here.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/help-with-if-statement/#post-4657453)
 * general:
 * [http://codex.wordpress.org/Function_Reference/is_page](http://codex.wordpress.org/Function_Reference/is_page)
 * try to use the page title or page slug in the if statement.
 * are you sure it is a _static _page?
 * also try to check the ID directly:
 * `<?php if ( $post->ID == 297 ) { ?>`

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

The topic ‘Help with if statement’ is closed to new replies.

 * 4 replies
 * 4 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/help-with-if-statement/#post-4657453)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
