• I want to display a person’s gravatar as a background image using CSS.
    Is there a way for me to get the path for the gravatar so I can use it in this way?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Here is a link to Gravatar.com and a method to get the gravatar url with PHP … hope that helps you in the right direction.

    https://en.gravatar.com/site/implement/php

    Thread Starter stucurry

    (@stucurry)

    Thanks for the response – I ended up editing pluggable.php (ahhh!) to just output the gravatar url but it’s not really a smart solution

    /* standard avatar code
    		$avatar = "<img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; */
    		$avatar = "{$out}";
    
    	} else {
    		/* standard avatar code
    		$avatar = "<img alt='{$safe_alt}' src='{$default}' class='avatar avatar-{$size} photo avatar-default' height='{$size}' width='{$size}' />"; */
    		$avatar = "{$default}";

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display gravatar as a background image’ is closed to new replies.