duanbing2963
2013-06-12 15:50
浏览 28
已采纳

添加include到wordpress functions.php返回

I have two scripts I need to combine for wordpress, basically my own custom share this links

The function which puts it in 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:

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

any help would be great, Im a newbie to PHP

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dsi36131 2013-06-12 15:53
    最佳回答

    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';
    }
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题