WordPress.org

Ready to get started?Download WordPress

Forums

get_avater $default (2 posts)

  1. JoeLongstreet
    Member
    Posted 4 years ago #

    <?php echo get_avatar($id_or_email, 50, $default_avatar ); ?>

    Three questions:

    1. According to the codex, to change the default avatar I would use $default = '<path_to_url>' as the last parameter. How do I make a relative call to an image inside <?php ?>. I'd like to do it similarly to how I call images -

    <img src="<?php bloginfo('stylesheet_directory'); ?>/img/someimage.jpg" alt="alt text here" />

    2. How can I add alt text using the get_avatar function?

    3. How can I link the gravatar image?

    Thanks for any help you can provide.

    Thank you,

    Joe

  2. adamh
    Member
    Posted 4 years ago #

    1. use get_bloginfo

    <img src="<?php get_bloginfo('stylesheet_directory'); ?>/img/someimage.jpg" alt="alt text here" />

    2. not sure, sorry

    3. just wrap the whole gravatar call in a link

    <a href="#" title="Link"><?php echo get_avatar($id_or_email, 50, $default_avatar ); ?></a>

    Hope that helps

    adam

Topic Closed

This topic has been closed to new replies.

About this Topic