One simple way would be to write:
<?php if(get_the_author_meta('pubemail')){ ?><div id="ap-email">Email: <?
$email = the_author_meta('pubemail');
echo enkode_mailto($email,$email);
?></div><?php } ?>
That <i>should</i> work. If it doesn’t, try calling enkode directly with the constructed link.
As a side note, I don’t know about you, but if I got any pubemail, I’d ask for it to be returned to sender. 😉
Thread Starter
bcw00
(@bcwint00)
Haha thanks! At the moment we’re trying to become fully complaint to qualify for Google News service, and they’re asking that we include some form of front facing contact per author. Usually I wouldn’t have done that but yea.
I was more commenting on the variable name, but I hear you. 🙂 Did that code fragment work?
Thread Starter
bcw00
(@bcwint00)
Ah ok! haha
Just tried it and it doesn’t seem to work.
I’ve got this as the raw output.
<div id="ap-email">Email: johndoes@johndoe.com<script type="text/javascript">the long string of code here</script><a href="mailto:"></a></div>
The email still showed up and the code didn’t seem to encode everything.
Okay, give this a try:
<?php if(get_the_author_meta('pubemail')){ ?><div id="ap-email">Email: <?
$email = the_author_meta('pubemail');
echo enkode("$email");
?></div><?php } ?>
Ugh, the forum just converted my link to an actual link—in the encode call up there, you want to encode <a href='mailto:$email'&rt;$email<a&rt;.
GAH, stupid forum software. I think you know what I mean…
Thread Starter
bcw00
(@bcwint00)
Yea figured out what you meant. The output is still the same though 🙁
I don’t know if the fact that it’s outside the loop and on the author page will make a difference to the equation?
No, it shouldn’t. Could you email me the exact code you’re writing in?