Try using get_comment_author_url.
if (empty(get_comment_author_url()) || get_comment_author_url() == 'http://' ) [ show form button]
Thanks Esmi, couldn’t get the above to work, but it made me think of a solution, ended up using this code:
<?php if($comment->comment_author_url != "") : ?>
Code for when there is a URL
<?php else : ?>
Code for when no URL.
<?php endif; ?>
Works exactly how I want it, added a little css to make the button look more like a link and only difference is when I hover over the button link no colour change (will fix that with css later).
Example at: http://www.free-funny-jokes.com/chuck-norris-jokes.html#comment-37410 where the ‘Joker’ comment is a form/button link, all the other comments didn’t have links as disabled the ability to add them to the theme ages ago.
Can renable commenters URLs now and not have to worry about loosing link benefit since Google fecked up how it treats the nofollow attribute!
David Law
(@seo-dave)
16 years, 10 months ago
Basically what I want is to use an if/else statement where
If comment_author_url NOT empty use this code else use some other code
In this way if a commenters added a URl I’ll use it with some associated code, if not I’ll show the author name (comment_author) with associated code.
I don’t want to use the comment_author_link function as I want to create the comment links using a form (so a form button is the link) so search engines won’t treat them as links (trying to get rid of nofollow links for SEO reasons).
Got it almost working here http://www.free-funny-jokes.com/yo-mamas-so-dumb.html minus the if not empty bit, so the form button link shows for all commenters with the URL part empty when the author doesn’t add a URL.
Not been able to figure out the not empty part.
Thanks
David Law