• I’m attempting to modify the RSS feed and only need the author image URL

    <?php userphoto_the_author_thumbnail(); ?>
    returns

    <img width="80" height="80" class="photo" alt="author name" src="http://domain.com/wp-content/uploads/userphoto/author.name.jpg"/>

    What returns
    http://domain.com/wp-content/uploads/userphoto/author.name.jpg
    ??
    Thanks for any assistance you can offer.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I would like to know that as well.

    +1

    Lol, I just did this 🙂

    <img src=<?php bloginfo(url);?>/wp-content/uploads/userphoto/<?php echo strtolower($curauth->nickname); ?>.jpg" title="<?php echo $curauth->nickname; ?>" alt="userphoto"/></a>

    I don’t know if it works on all users.. And it always should be .jpg 🙂

    spacechampion

    (@spacechannel)

    that will only work if the photo is a jpg.

    dikkevandale

    (@dikkevandale)

    That’s what I said in my post 🙂

    eddyfly

    (@eddyfly)

    Not wanting to mess about with the plugin, I did this on the font end instead.

    // regular expression:
    $matchSrc = "/src=[\"' ]?([^\"' >]+)[\"' ]?[^>]*>/i" ;
    // get the <img src="... from the plugin, via one on various methods explained in the documentation...
    $avatar = get_avatar($user->ID, 64); // for example
    // preg match to extract the src= bit
    preg_match($matchSrc, $avatar, $matches);
    $theImageUrl = $matches[1];

    That gives you everything between src=”[…]”.

    I wanted to use it for the background of a div…

    echo "<div style='background:url($theImageUrl) center no-repeat;'>";

    I hope it helps 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: User Photo] How do I return just the image URL?’ is closed to new replies.