I have a post which has a custom wp_list_comments(). Works fine.
I wanted to add a custom comment field but couldn’t make it work.
So, I’m using the default url field as a custom field (city).
<li class="comment-form-url">' . '<label for="url">City *</label>' . '<input id="url" name="url" type="text" value="" />' . '</li>'
Works fine, but when I call out the comment fields, the url-city value, called with comment_author_url() displays like this http://value.
So, if somebody put in Brussels, it will display as http://Brussels
Obviously, I want the http:// gone.
How do I solve this in php? I already tried this:
<?php echo substr(comment_author_url(),7); ?>
But wordpress just ignores the extra php and prints the value as if I had put in
<?php echo comment_author_url(); ?>
I’d rather not fiddle around in the core files either.
- The topic ‘comment_author_url()’ is closed to new replies.