Wordpressで自動生成されるコンテンツのURLをhttp://ドメイン 部分を表示させないように設定しています。
ですが、SNSにシェアさせるURLまで相対パスで表示されてしまいます。

<?php echo 'http://hogehoge.com' ?><?php the_permalink(); ?>

上記のようにechoで出力させようとしても、ドメイン部分が取得されていません。
特定した要素のみドメインを表示させる事は可能でしょうか?
下記のコードがfunction.phpに記載しているドメイン非表示用のコードです。

<?php
class relative_URI {
    function relative_URI() {
        add_action('get_header', array(&$this, 'get_header'), 1);
        add_action('wp_footer', array(&$this, 'wp_footer'), 99999);
    }
    function replace_relative_URI($content) {
        $home_url = trailingslashit(get_home_url('/'));
        return str_replace($home_url, '/', $content);
    }
    function get_header(){
        ob_start(array(&$this, 'replace_relative_URI'));
    }
    function wp_footer(){
        ob_end_flush();
    }
}
new relative_URI();
?>

よろしくお願いいたします。