WordPress.org

Ready to get started?Download WordPress

Forums

If author_has_url (4 posts)

  1. idbehold
    Member
    Posted 9 years ago #

    Is there something like this, I'm trying to do what Josh is doing with comment author's URLs, however when I setup my php up like so:

    {cite}{a href="{?php comment_author_url(); ?}"}{?php comment_author(); ?}{span} : {?php comment_author_url(); ?}{/span}{/a}{/cite}

    It will make the author's name linked even if they didn't enter a URL for their site, instead it links to the page you are currently on. Any advice?

  2. Kafkaesqui

    Posted 9 years ago #

    I use something similar to the following:

    <?php if(!get_comment_author_url()) : ?>
    <?php comment_author(); ?>
    <?php else : ?>
    <a href="<?php comment_author_url(); ?>"><?php comment_author(); ?></a>
    <?php endif; ?>

  3. idbehold
    Member
    Posted 9 years ago #

    Did I ever tell you how much I love you?

  4. Kafkaesqui

    Posted 9 years ago #

    You never needed to. But it's always nice to hear...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.