简体   繁体   English

包含在 $ 如何在代码中嵌入包含?

[英]include in $ How do I embed include in the code?

How do I embed include in the code?如何在代码中嵌入包含?

**I want this page (tabtab.php) to be displayed before $content **我希望这个页面 (tabtab.php) 在 $content 之前显示
Page tabtab.php is not currently displayed with this code .当前未使用此代码显示页面 tabtab.php。 ** **

if(!empty($mp3Link)) { 

 $linkHtml = '
<a class="w3-black" href="#ucomment">com</a>   
 
' . include (TEMPLATEPATH . '/tabtab.php') . ' 
     
   ';
                
     
};

        $mp3Info = 
            
            "<h2><p><span>1 : </span><span>$mp3_caption</span></h2></p>";
            

        return $imageTag.$mp3Info."<br/>".$playerTag."<br/>".$linkHtml.$content;
    }

    return $content;

}
add_filter('the_content', 'append_mp3_file');

You need to make the include function part of PHP and not the string,您需要使包含函数成为 PHP 的一部分,而不是字符串,

if(!empty($mp3Link)) {

    $linkHtml = '



<a class="w3-black" href="#ucomment">comen</a>   
<span id="ucomment"></span>  
' . include (TEMPLATEPATH . '/single_ads.php') . '   **// I want to embed it here**


   ';
      
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM