Logo won't redirect to home page
-
I’m working in a twenty twelve child theme. When the logo is clicked, it does not go back to the home page. Can someone tell me how to fix that, please?
Site is http://testarea.sdaseattle.org/
-
Did you modify this part of the header.php file?
<h1 class="site-title"><a href="http://testarea.sdaseattle.org/" title="Still Testing" rel="home"><a href="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent.jpg"><img class="alignnone size-medium wp-image-443" src="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent-300x76.jpg" alt="SDALogoTagline_Transparent" width="300" height="76" /></a> </a></h1>
This part is the link for that logo:
<a href="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent.jpg">
I modified that h1 text to add the logo, but not sure why the logo won’t get you back to home page when clicked.
That code links to the image – which is why it’s going there.
Could you post your header.php file to a pastebin?
http://codex.wordpress.org/Forum_Welcome#Posting_Large_Excerpt_of_Code
Will do on the pastebin. Waiting to be registered so I can do that. Thanks for hanging in there with me. Will send header.php soon as I can via pastebin.
Okay, let’s see if I did this pastebin thing right. So this link will let you see the contents of my header.php of my twenty twelve child theme?
Okay, so replace just this section:
<h1 class="site-title"><a href="<?php echo esc_url( home_url( \'/\' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( \'name\', \'display\' ) ); ?>" rel="home"><a href="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent.jpg"><img class="alignnone size-medium wp-image-443" src="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent-300x76.jpg" alt="SDALogoTagline_Transparent" width="300" height="76" /></a> </a></h1>
with this:
<h1 class="site-title"><a href="<?php echo esc_url( home_url( \'/\' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( \'name\', \'display\' ) ); ?>" rel="home"><a href="http://testarea.sdaseattle.org"><img class="alignnone size-medium wp-image-443" src="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent-300x76.jpg" alt="SDALogoTagline_Transparent" width="300" height="76" /></a> </a></h1>
When I replaced that, all I get is nothing, just a white page. (Those two lines of code you showed up look the same to me.)
What I’m trying to do is:
If I’m on the Sponsors page, for example, I should be able to click the SDA logo in the header and it will take me back to the Who We Are page.Right now if I’m on the Sponsors page (or any other page except for Who We Are), if I click the SDA logo at the top, it just opens up that logo like I’m looking at an enlarged logo and nothing else.
@wpyogi. Just wanted you to know that I didn’t realize there was more text in what you said to “replace this section” with “this.” So I tried doing that (making sure I had captured all of the text), and still, all I get is a white page. Nothing. When I undo what I did, then my site comes back up.
Oh sorry, I didn’t see you’d replied until now. Let me test that on my test site – be back in a short bit.
It looks like you’ve modified a bunch of other stuff in that file… including the file paths?
But see if this works:
<h1 class="site-title"><a href="http://testarea.sdaseattle.org"><img class="alignnone size-medium wp-image-443" src="http://testarea.sdaseattle.org/wp-content/uploads/2015/04/SDALogoTagline_Transparent-300x76.jpg" alt="SDALogoTagline_Transparent" width="300" height="76" /></a> </h1>
That worked, thank you!
Okay, excellent :)! One thing you should be aware of is that if you move the site, you’ll have to manually change that link to the home page/site – it’s hard-coded. (Since that’s a “testarea” – guessing you may be moving it?)
- The topic ‘Logo won't redirect to home page’ is closed to new replies.