obeattie
Member
Posted 6 years ago #
Hi All,
I am currently writing a theme and wanted to make it the best it can be. I am writing the 404 error page, and want to include a link to email the webmaster. I was wondering if it is possible to run the bloginfo('admin_email') through antispambot in something like this? :
mailto:<?php antispambot(bloginfo('admin_email')); ?>
Is that possible or is it just wishful thinking?
Any help would be much appreciated.
Many Thanks,
Oliver
What I think you're missing is the echo. See this thread:
http://wordpress.org/support/topic/42718
obeattie
Member
Posted 6 years ago #
OK. So would:
mailto:<?php echo antispambot(bloginfo('admin_email')); ?>
work? I just didn't think that you would be able to nest the bloginfo command...?
obeattie
Member
Posted 6 years ago #
Or would I need:
mailto:<?php echo antispambot(bloginfo('admin_email);); ?>
??
Try:
mailto:<?php echo antispambot(get_bloginfo('admin_email')); ?>
obeattie
Member
Posted 6 years ago #
No: that just returns mailto:~this is blank~
Any other suggestions?
I have tried the antispambot(bloginfo('admin_email')); too, but that doesn't encode the address, just returns it in plain text.`
"...but that doesn't encode the address, just returns it in plain text."
Because bloginfo() cannot be used the way you're trying to use it; it only *echoes* output and doesn't return it back to your code. The one I suggested, get_bloginfo(), does exactly what bloginfo() does, only it returns any output. If that returned value happens to be empty, then something else is amiss.
obeattie
Member
Posted 6 years ago #
Well, usually something missing in some part of the code. As a test, what do just:
<?php bloginfo('admin_email'); ?>
and
<?php echo get_bloginfo('admin_email'); ?>
display?
obeattie
Member
Posted 6 years ago #
Hi There,
I am so sorry.. I missed out the echo (Doh!)
Many Thanks for all your help, with the echo it all works fine now!
Many Thanks again,
Oli