Title: Use PHP-script on all pages except one
Last modified: August 20, 2016

---

# Use PHP-script on all pages except one

 *  [nasspray](https://wordpress.org/support/users/nasspray/)
 * (@nasspray)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/use-php-script-on-all-pages-except-one/)
 * I’m trying to use an Php-script in the footer.php on all pages except one. But
   it doesn’t work, i got an error message when i try it.
 * Can someone see whats the problem with this code:
 *     ```
       <div class="testimonials">
       			<?php
   
       			if ( is_page('5') ) {    // Show nothing.
       			}
       			else {
       				<?php displaytestimonials(); ?>
       			}
       			?>
       </div>
       ```
   
 * Thanks

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

 *  [3wd](https://wordpress.org/support/users/3wd/)
 * (@3wd)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/use-php-script-on-all-pages-except-one/#post-2196811)
 * Are you actually nesting PHP opening and closing tags like this:
 * <?php
 *  if ( is_page(‘5’) ) { // Show nothing.
    } else { **<?php** displaytestimonials();**?
   >** } ?>
 * If so, you have to erase them
 *  Thread Starter [nasspray](https://wordpress.org/support/users/nasspray/)
 * (@nasspray)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/use-php-script-on-all-pages-except-one/#post-2196820)
 * No it works if i use:
 *     ```
       <div class="testimonials">
       			<?php
   
       			if ( is_page('5') ) {    // Show nothing.
       			}
       			else {
       				displaytestimonials();
       			}
       			?>
       </div>
       ```
   
 * But it also shows up on the page with id=5 that I don’t want it on.

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

The topic ‘Use PHP-script on all pages except one’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [nasspray](https://wordpress.org/support/users/nasspray/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/use-php-script-on-all-pages-except-one/#post-2196820)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
