如何在 If 语句中显示引号

How to display quote marks within an If statement

我有下面的代码,在 if 语句中有一个联系表单的简码,但联系表单没有显示。我认为这是因为我在错误的地方显示了引号,但我对它们应该放在哪里感到有点困惑

我的代码是:

<?php 

if ($postid == "page-international.php" or $postid == "page-international-training.php" or $postid == "page-international-courses.php" or $postid == "page-international-training-course-detail.php") {
echo "<div class='get-ebook'><img class='close-ebook' src='https://www.pescado.co.uk/wp-content/themes/entyce/images/close-button-get.png' /><p class='title'><strong>Is your <br>scaffolding safe?</strong></p><span class='img'><img src='http://dev14.entycestudio.co.uk/wp-content/themes/custom/images/get-ebook.png' />

</span><?php echo do_shortcode('[contact-form-7 id='6664' title='ebook']' ); ?>

</div>";

} else {
echo "";
}

?>

如果有人能提供帮助,或为我指出正确的方向,将不胜感激:-)

谢谢

您的问题可能是 do_shortcode 在 echo ""; 中,请尝试将其从那里删除。像这样

  echo "<div class='get-ebook'><img class='close-ebook' 
  src='https://www.pescado.co.uk/wp-content/themes/entyce/images/close-
  button-get.png' /><p class='title'><strong>Is your <br>scaffolding
  safe?</strong></p><span class='img'><img 
  src='http://dev14.entycestudio.co.uk/wp-content/themes/custom
  /images/get-ebook.png' />

  </span>";echo do_shortcode('[contact-form-7 id="6664" title="ebook"]' ); 

  echo "</div>";

  } else {
  echo "";
    }