WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help me add a "alt" attribute in this code. (3 posts)

  1. diego018
    Member
    Posted 1 year ago #

    I want that my gravatars have the "alt" attribute in the image. what should i change? this is my template code:

    <div class="comment-author vcard">
             <?php echo get_avatar($comment,$size='50',$default='' ); ?>
    		<a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"> <?php comment_date('n-j-Y'); ?></a>
          </div>

    thanks !

  2. mediopirzel
    Member
    Posted 1 year ago #

    You can read this page in the codex.
    http://codex.wordpress.org/Function_Reference/get_avatar

  3. diego018
    Member
    Posted 1 year ago #

    i have found how, i just added a $alt='' :

    <div class="comment-author vcard">
    <?php echo get_avatar($comment,$size='50',$default='' ,$alt='grav' ); ?>
    comment_ID ) ) ?>"> <?php comment_date('n-j-Y'); ?>
    </div>

    thanks ;D

Topic Closed

This topic has been closed to new replies.

About this Topic