• 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)
  • 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

    (@nasspray)

    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.