简体   繁体   English

将include添加到wordpress functions.php返回

[英]adding include into wordpress functions.php return

I have two scripts I need to combine for wordpress, basically my own custom share this links 我有两个脚本需要结合用于wordpress,基本上我自己的自定义共享此链接

The function which puts it in the_content() ; 将其放入the_content()的函数;

add_filter( "the_content",'addstyling', 5 );

function addstyling($content){  
    global $post;
    return ''.$content.'<br><br>Sharethis';
}

and the other code is just html inside a file, used through an include: 其他代码只是文件中的html,可通过include进行使用:

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

any help would be great, Im a newbie to PHP 任何帮助都会很棒,我是PHP的新手

Not quite sure what you're asking, but if you want your include file adding to the post: 不太清楚您要问的是什么,但是如果您想要将包含文件添加到帖子中:

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

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

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