WordPress.org

Support

Support » Plugins and Hacks » Trackbacks only as domain

Trackbacks only as domain

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sooo.. you’ve got a URL, and you want to get the hostname only from it, right?

    Example code you can use to figure out how to make your theme do what you want:

    $url = 'http://example.com/someurl/whatever';
    $url_bits = parse_url($url);
    echo $url_bits['host'];

    Thanks Otto, with a little bit of playing, this is what you should put (should you ever need it)

    <?php
    $url_bits = parse_url($comment->comment_author_url);
    $url = str_replace("www." , "", $url_bits['host']);
    ?>
    			<a href="<?php comment_author_url(); ?>"><?php echo $url; ?></a>,
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trackbacks only as domain’ is closed to new replies.
Skip to toolbar