Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.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
将include添加到wordpress functions.php return_Php_Wordpress_Include - Fatal编程技术网

将include添加到wordpress functions.php return

将include添加到wordpress functions.php return,php,wordpress,include,Php,Wordpress,Include,我有两个脚本,我需要结合wordpress,基本上我自己的自定义共享这个链接 将其放入内容()中的函数 任何帮助都很好,我是PHP的新手,不太清楚你在问什么,但是如果你想在帖子中添加include文件: function addstyling($content){ global $post; $share = file_get_contents(TEMPLATEPATH . '/includes/share.php'); return $share . $conte

我有两个脚本,我需要结合wordpress,基本上我自己的自定义共享这个链接

将其放入内容()中的函数


任何帮助都很好,我是PHP的新手,不太清楚你在问什么,但是如果你想在帖子中添加include文件:

function addstyling($content){  
    global $post;
    $share = file_get_contents(TEMPLATEPATH . '/includes/share.php'); 
    return $share . $content . '<br><br>Sharethis';
}
函数addStyleing($content){
全球$员额;
$share=file_get_contents(TEMPLATEPATH.'/includes/share.php');
返回$share.$content.“

共享此”; }
Brilliantl为我的布局函数addStyleing($content){global$post;$share=file_get_contents(TEMPLATEPATH./includes/share.php');return$content.$share;}带来了我想要的文件,但当涉及到诸如a href的URL时,它破坏了内容,例:
  • 效果很好,但下面的中断
  • 有什么想法吗?
    include(TEMPLATEPATH . '/includes/share.php'); 
    
    function addstyling($content){  
        global $post;
        $share = file_get_contents(TEMPLATEPATH . '/includes/share.php'); 
        return $share . $content . '<br><br>Sharethis';
    }