0

I'm just a starter in WordPress. I found the one I'm looking for but I can't make it work.

I want to add a script when the travel page is shown and it's hidden when the user navigates to the rest of the page.

This is the code snippet under Footer.php:

<?php 
  wp_footer(); 
  is_page( 'need-travel-insurance' ) {
    echo "For travel.";
  }
?>

If I start to echo something, the whole footer including widgets does not completely show. What could I be doing wrong here?

0

if condition check is missing in your code. Try this:

<?php 
  wp_footer(); 
  if(is_page( 'need-travel-insurance' )){
    echo "For travel.";
  }
 ?>  

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.