WordPress.org

Ready to get started?Download WordPress

Forums

the_author_link (4 posts)

  1. Mithrustt
    Member
    Posted 6 years ago #

    I really don't know what it is, but I can't seem to make an image also a link with the_author_link. It works with every other link I try, but as soon as I try the_author_link, it messes up.

    This is the code I'm using:

    <?php if ( get_post_meta($post->ID, 'profile', true) ) { ?>
    
    <div class="profile_img_home"><a href="<?php the_author_link(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/profile/<?php echo get_post_meta($post->ID, "profile", $single = true); ?>" alt="<?php the_author(); ?>" /></a></div>
    
    <?php } ?>

    To see what happens with the link, please just look at my home page where I have it applied. To the right of the post title, I have the images I'm trying to make a link, which sends you to the website the post author has specified in their profile. For some reason, this link doesn't wrap around the image and when you hover the link, it tells you that it will take you to: http://think-theory.com/<a href=

    Not sure what's going on here. Any help is greatly appreciated.

  2. Mithrustt
    Member
    Posted 6 years ago #

    Come on, surely someone knows what's going on here.

  3. Mithrustt
    Member
    Posted 6 years ago #

    Dang it, I've tried so many different things, but nothing works. Why does it seem this isn't possible?

  4. spacebrew
    Member
    Posted 5 years ago #

    What is your home page? I'd like to take a look. I think your problem is that you're trying to anchor an already anchored link. Try using the_author_url instead of the_author_link. That way it's not hot on its own.

Topic Closed

This topic has been closed to new replies.

About this Topic