Title: Need help with cleaning up some PHP code
Last modified: August 19, 2016

---

# Need help with cleaning up some PHP code

 *  [Fahad](https://wordpress.org/support/users/fahadtariq/)
 * (@fahadtariq)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-cleaning-up-some-php-code/)
 * Hi. I have a couple of conditions in stating which content is displayed depending
   on what article the user is. I have no PHP knowledge. Below is the code:
 *     ```
       <?php
       if ( is_single('179') ) {
       } elseif (is_single('254')) {
       } elseif (is_single('130')) {
       } elseif (is_single('95')) {
       } elseif (is_single('35')) {
       } elseif (is_single('27')) {
       } elseif (is_single('419')) {
       } elseif (is_single('226')) {
       } elseif (is_single('381')) {
       } elseif (is_single('349')) {
       } elseif (is_front_page()) {
       } elseif (is_single('254')) {
       } else {
       include(TEMPLATEPATH . '/file1.php');
       }
       ?>
       ```
   
 * There must be some way I can clean the above code so that only 1 is_single statement
   remains. I tried but couldn’t get it to work. If somebody can fix this, it would
   be great. Thanks.

The topic ‘Need help with cleaning up some PHP code’ is closed to new replies.

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [if](https://wordpress.org/support/topic-tag/if/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Fahad](https://wordpress.org/support/users/fahadtariq/)
 * Last activity: [17 years, 6 months ago](https://wordpress.org/support/topic/need-help-with-cleaning-up-some-php-code/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
