WordPress.org

Support

Support » How-To and Troubleshooting » Comment Link Broken

Comment Link Broken

  • HI All. I posted this a few days ago and I didn’t get a response. I’d really appreciate any help or advice.

    When someone leaves a comment they are prompted for name, email and website which is optional. If someone doesn’t enter a website and leaves the URL field blank then there is a problem. The name is hyperlinked to a url consisting of just this: http://website – which is a broken link.

    Can anyone help me configure the URL to point to nothing if the URL field is left blank?

    Here’s a URL with comments for example: http://www.tune-in-tokyo.com/2008/09/japanese-idol-miri-hanai/

    Thank you,
    Billy

Viewing 4 replies - 1 through 4 (of 4 total)
  • Are you using the Delink Comment Author plugin or something similar? I ask because I see that comment nr. 3 has no link on the author name.

    I’m not using any comment plugins. Maybe I should.

    Comment #3 was made by me when I was logged in as admin so I guess theres not a link for that situation.

    I’m going to look at the plugin you mentioned.

    Can someone please take a peak at this code where I suspect the problem lies:

  • <input type=”text” name=”url” id=”url” value=”Website” size=”22″ tabindex=”3″ onblur=”if(this.value.length == 0) this.value=’Website’;” onclick=”if(this.value == ‘Website’) this.value=”;” />

That code seems to be working correctly.

You should instead see your comment-template.php where it outputs the author URL, where you should have something like this:

if ( 'Website' == get_comment_author_url() ) {
  // display author without link
} else {
  // display author normally
}

Either that, or you could move the text from inside the input to the side:

<input type=”text” name=”url” id=”url” value=”” size=”22″ tabindex=”3″ /> Website

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Comment Link Broken’ is closed to new replies.