Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress PHP在使用file\u get\u内容时注释掉了_Php_Html_Wordpress_File Get Contents - Fatal编程技术网

Wordpress PHP在使用file\u get\u内容时注释掉了

Wordpress PHP在使用file\u get\u内容时注释掉了,php,html,wordpress,file-get-contents,Php,Html,Wordpress,File Get Contents,下面的wordpress短代码在single.php中正确运行 <?php echo do_shortcode( '[contact-form-7 id="13" title="KB EN Contact"]' ); ?> php显示为注释掉的HTML。正确显示周围的HTML元素 <section id="contact-after-post" class="clearfix"> <h3 id="contact-after-post-title">

下面的wordpress短代码在
single.php中正确运行

<?php echo do_shortcode( '[contact-form-7 id="13" title="KB EN Contact"]' ); ?>

php显示为注释掉的HTML。正确显示周围的HTML元素

<section id="contact-after-post" class="clearfix">
    <h3 id="contact-after-post-title">Didn't find what you were looking for?</h3>
      <div id="contact-after-post-number">
      </div>
      <div id="contact-after-post-number-click">
        <div id="number-left">
        </div>
        <div id="number-right">
        </div>
      </div>
      <div id="contact-after-post-form">
<!--?php echo do_shortcode( '[contact-form-7 id="13" title="KB EN Contact"]' ); ?-->
      </div>
</section>

没有找到你要找的东西?

为什么会这样?为什么外部文件的行为会发生变化?

您可以尝试使用include()函数代替file\u get\u contents()

代码:

<?php include("en-contact.php");  ?>

提示:WordPress中有
<?php include("en-contact.php");  ?>