Support » Fixing WordPress » cant get this code to work

  • this is what i have but i cant get the image to display

    <a href="<?php the_author_meta( 'user_url' ); ?>"><img class="aligncenter" title="<?php the_author_meta( 'display_name' ); ?>’s Website" alt="Author Webite Link" src="<?php echo get_avatar( get_the_author_meta('ID'), 32 ); ?>"> </a>

    it just gets a broken link and “> in hyperlink text on certain pages

    i know that get_avatar does work, there’s just something wrong in the code. everything else works fine, the link, the alignment, the title, everything but the image.

    [ please read: ]

Viewing 1 replies (of 1 total)
  • The problem is that get_avatar() returns a complete img tag, not just a URL. You are getting something like this:

    <a href=""><img class="aligncenter" title="jones’s Website" alt="Author Webite Link" src="<img alt='' src='' class='avatar avatar-32 photo' height='32' width='32' />"> </a>

    See the src="<img alt='' ... />"> part? That is incorrect because get_avatar() is inserting the complete img tag.

Viewing 1 replies (of 1 total)
  • The topic ‘cant get this code to work’ is closed to new replies.