• Is there anyway to add <?php the_author_email(); ?> to this code? I can’t seem to get it working correctly.

    <?php
    	$md5 = md5( $email="<?php the_author_email(); ?>" );
    	echo "<img src="http://www.example.com/avatar.php?id=$md5' alt='' />";
    ?>

    Any ideas? I just modified this code to not show any links and used examples instead. I just want the e-mail to actually change into the post author’s e-mail and then MD5 encode it. If I remove the md5 encoding then it would just show the <?php the_author_email(); ?> instead of the full e-mail.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 1. Use:

    get_the_author_email()

    Most of the simpler Template Tags have a do not echo, just return the value version, as this one does.

    2. Do not nest <?php ... ?> tags. This:

    md5( get_the_author_email() )

    should do what you want.

    Thread Starter shaythong

    (@shaythong)

    Wow, that really works! Thanks, Kafkaesqui!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add the_author_email to a code?’ is closed to new replies.