How to make my logo link to website

Started by joeyrss, August 09, 2013, 10:24:33 PM

Previous topic - Next topic

joeyrss

Hi there, back for some expertise from all you wonderful folks.  ;)

Please tell me in simple terms how to make my logo a link to a website and where I go to do this? The theme is Dhari and I think this is what you need to help? Forever learning...  :P  Like this?

ARG01

You should probably attach your file as opposed to linking it.  ;)

That said, most logo code looks like this or similar:

<a id="logo" href="'.$scripturl.'">' . $context['forum_name'] . '</a>


Just change it to something like this:

<a id="logo" href="http://simplemachines.org">' . $context['forum_name'] . '</a>

You get the idea.
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

joeyrss

#2
Thanks, I do get the idea, just can't find the code. Is it this?

<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo.png" alt="' . $context['forum_name'] . '" />' : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>         
    </h1>';

ARG01

That depends? Are you wanting to change the link of the text on the left of the header area or add a link to the actual logo on the right?

To change the url to the text on the left find:

<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>


replace:
<a href="http://simplemachines.org">', empty($context['header_logo_url_html_safe']) ? $context['forum_name'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name'] . '" />', '</a>


To add a link to the logo on the right find:

', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</div>', '
</div>



replace:
<a href="http://simplemachines.org">', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '</a></div>', '
</div>


Of course, change the http://simplemachines.org with your own url and save a backup of your file before making changes.
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

joeyrss

I already replaced the theme logo in the upper right corner with our website logo and now want it to click through to our website, so I guess I am making the link change on the left. The code I posted looks a little different that what you posted, is  it the one I need to change?

ARG01

Disregard the code in my first reply. That is just the basic for most custom themes. Since you are using the default theme you want to use the code I posted for the left side.
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

joeyrss

Okay, I'm not using default theme though, it's Dhari and this is what I am looking at as where to make the changes where it says "$scripturl," after I do a file back-up. Is this right?

<a href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo.png" alt="' . $context['forum_name'] . '" />'

ARG01

Yes, this is the code that you want to use.

<a href="http://simplemachines.org">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo.png" alt="' . $context['forum_name'] . '" />'
No, I will not offer free downloads to Premium DzinerStuido themes. Please stop asking.

joeyrss

Thank you. I will let you know how it goes, so maybe keep this open for now.  :)

joeyrss

Happy dance, it worked! Thanks, now another question. How can I make the link open in another window?

Chalky

Add target="_blank" after the URL, like this:

<a href="http://simplemachines.org" target="_blank">', empty($context['header_logo_url_html_safe']) ? '<img src="' . $settings['images_url'] . '/theme/logo.png" alt="' . $context['forum_name'] . '" />'

joeyrss

Thank you CK! It worked and this makes me see how much I've grown since first coming in here with fingernails bitten down bad..lol.  ;)

You helped me a lot and I just did my first file back-up thanks to your great teaching as well. My group is coming into the forum now and are pretty amazed that I did it by myself but I tell them that some of the smf support people are incredible so pat yourself on the back big time! xxx

I'll be back again.  :)

Chalky

File back-up    well done  :D  It's amazing how much you learn just getting your forum going, isn't it?  Then comes the moment of pride when you look at your forum and people are posting in it and you go "wow, I did this!"   :D  I think you're the one that deserves a huge pat on the back  :)

Keep having fun, see you soon 

Hypnos76

Cool, I was just looking for the same thing ;)  I only wanted to change the link, worked for me.  :D

joeyrss

#14
Thank you CK. It is a great feeling and I still have so much to learn but I am realizing that my brain is better now than it was in high school but maybe because I am actually listening now.  ::) The people mean a lot to me and I want to make sure they have a good place to find support and comfort in their illness for sure.

I now have to set up the practice database and do a trial run of the restore so I know just how to do this. I just spend quite a bit of time on the filezilla stuff and binary mode etc.  I wanted to ask you if you delete old files once you do a new backup?

Also, can you use the "target blank" on redirect links as well? Where would I look to find their code? In the current theme or default index? Thanks...

Advertisement: