squareink
Member
Posted 2 years ago #
Hello
I have entered an e-mail address as my "Blog Description". How can I make this into a mailto: hyperlink?
<div id="blog-description"><?php bloginfo('description') ?></div>
As I am only familiar with html and not php I am unsure where/ how to add code for it to work.
Any help would be appreciated!
Many thanks
So the description is also the email address?...
If that's the case then...
<div id="blog-description"><a href="mailto:<?php bloginfo('description') ?"><?php bloginfo('description') ?></a></div>
squareink
Member
Posted 2 years ago #
it didn't work. I got a Parse error: syntax error, unexpected T_STRING
and yes, I've entered only an e-mail address.
It is the tag line it is linking to if that makes it more clear. And I am also using the autofocus theme.
totalbigbrother
Member
Posted 2 years ago #
If people send email to "Blog Description" it will just float round in space?
Why not send it to your email address?..
<div id="blog-description"><a href="mailto:YOU@DOMAIN.com</a></div>
Sorry try...
<div id="blog-description"><a href="mailto:<?php get_bloginfo('description') ?"><?php bloginfo('description') ?></a></div>
or
<div id="blog-description"><a href="mailto:<?php echo get_bloginfo('description') ?"><?php bloginfo('description') ?></a></div>
My mistake, should of used the correct function first time (get_bloginfo, instead of bloginfo for the link part).
tbb (guy above), the description is in the format of xxx@xxx.com ...
If he wanted to hardcode it i'm sure he'd have never asked..
squareink
Member
Posted 2 years ago #
If someone does know what I did wrong or another way of doing it, then please let me know but for now I am just going to replace the php function with manually written code within that div instead.
squareink
Member
Posted 2 years ago #
oops sorry guys, didn't see the reply before I posted my last comment! I'll try to change the code and see if it works.
squareink
Member
Posted 2 years ago #
didn't work either. I'll just go with the hard coded way instead. Wont be much changing of themes/ updates etc on this website anyway.
Thanks for trying though!
Again my mistake giving you incorrect code...
Use this and it will work (i tested it this time)... ;)
<div id="blog-description"><a href="mailto:<?php echo get_bloginfo('description') ?>"><?php bloginfo('description') ?></a></div>