Forums

[resolved] [closed] Changing the blog description in the header to be e-mail hyperlink (10 posts)

  1. 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

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    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>

  3. 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.

  4. 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>

  5. Mark / t31os
    Moderator
    Posted 2 years ago #

    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..

  6. 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.

  7. Mark / t31os
    Moderator
    Posted 2 years ago #

    See my previous reply..

  8. 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.

  9. 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!

  10. Mark / t31os
    Moderator
    Posted 2 years ago #

    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>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.