在wordpress functions.php return中添加include



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

将其放入the_content()的函数;

add_filter( "the_content",'addstyling', 5 );
function addstyling($content){  
    global $post;
    return ''.$content.'<br><br>Sharethis';
}

和其他代码只是一个文件内的HTML,通过include:

使用
include(TEMPLATEPATH . '/includes/share.php'); 

任何帮助将是伟大的,我是一个新手PHP

不太确定你在问什么,但如果你想要你的包含文件添加到post:

function addstyling($content){  
    global $post;
    $share = file_get_contents(TEMPLATEPATH . '/includes/share.php'); 
    return $share . $content . '<br><br>Sharethis';
}

最新更新