Check if comment author has url

I wanted to add target=_blank to comment author link and also wanted to add redirection link to url.

So here is what I did:

<a href=”site.com/go?url=<?php echo get_comment_author_url” target=”_blank”><?php echo get_comment_author(); ?></a>

It works, but if comment author has no website I want to echo this:

<span><?php echo get_comment_author(); ?></span>

So, how to check if comment author entered url field?

Read more here:: Check if comment author has url

Leave a Reply

Your email address will not be published. Required fields are marked *