Support » Fixing WordPress » links posted in posts or comments formatted wrong

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must specify the protocol for the url (i.e. http:// <– web url); otherwise the browser must assume the link is a location on your site. So:

    http://www.yahoo.com

    is seen as a local path, whereas:

    http://www.yahoo.com

    is seen as a site url/address.

    thx a lot… any way around this, as i find it rather confusing for rather inexperienced commet posters… or do i just have to edit their comments in case?!

    Well, let’s see…

    Simple: You could place an “http://” as the initial value for the comment form’s “Website” input field to prompt them. The field is found in wp-comments.php (or comments.php for 1.5 theme templates).

    In 1.5’s default theme comment.php, change the value to:

    value="<?php if($comment_author_url) { echo $comment_author_url; } else { echo 'http://'; } ?>"

    Not so simple:

    There are ways through PHP (as a hack to the script, or a plugin) to try and assure that web URLs are prefixed with the proper http scheme. These could be used to filter both the website URL and the contents of a comment. Just not easy to cover in an off-the cuff forum reply. :)

    never mind then 🙂 i’m just getting into PHP and right now am proud that i managed to understand most of the content of the default theme folder 🙂

    for now i’ll just settle with adding a little line above the comment field that urls have to be prefixed with http:// and in case somebody ignores that, i’ll have to edit the comment…

    thx for your quick and comprehensive help, very much appreciated!

    steVe

    Just in case, a plugin solution:

    Plugin: Auto-hyperlink URLs

    the plugin works really nice and solves all the trouble i had with the default wp function

    thx a lot

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘links posted in posts or comments formatted wrong’ is closed to new replies.