• For my comments I have a href set up around the authors name so it links directly to the site they entered in the URL part of the comment form, however, when someone doesn’t enter an address, the name links back to the post/page you are already on. Is there some sort of function I can use to disable linking when the author has not entered a URL? THANKS!

Viewing 3 replies - 1 through 3 (of 3 total)
  • This any use?

    Haven’t tried it when no url is entered

    <?php comment_author_link() ?> displays the name of the author as defined in Admin Panel / Users / Authors and Users or as entered into the author input field.

    The name of the author acts as a link to the author’s website as defined in Admin Panel / Users / Authors and Users or as entered into the url (website address) input field.

    Note the rel=’external nofollow’
    See: http://codex.wordpress.org/Template_Tags/comment_author_link

    Thread Starter davidt82

    (@davidt82)

    ok – tried this, it still links all authors names, and in the case of this <?php comment_author_link(); ?> it links back to a page with that user name (ie: example.com/author)

    here is the code I have, if anyone has a suggestion, please let me know:

    <*a* href=”<?php comment_author_link(); ?>” target=”_blank”> <?php comment_author() ?> Says:</h4>

    the asterisks around the a are just to prevent this from turning into a link.

    comment_author_link should provide a link, no need to add the < a href

    Also, there was no closing tag to the link, but that might be because you only pasted part of it

    Check your view source to see what was outputted, this alone might be the problem

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘in comments, how to turn off link if author didn’t enter URL?’ is closed to new replies.