Reputation: 57
In my new website I have a logo that when clicked should return visitors to the home page. But instead it returns the 404 error page. The code for this in header.php is this:
<div id="branding">
<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php bloginfo('template_directory'); ?>/images/brandlogo.svg" alt="Luchtspin"></a>
</div>
Why is this happening? In footer.php I use exactly the same link and there I experience no troubles:
<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">all content © <?php echo date("Y"); ?> <?php bloginfo( 'name' ); ?></a>
Background info: the original theme used is Rostar (http://wpdemo.dannci.com/preview/customfields?wptheme=Rostar). I redesigned it, made it translatable and eventually married it to the Boilerplate/Starkers theme (http://wordpress.org/extend/themes/boilerplate). Adventurous, I know. Especially since I am new to PHP.
Additional info: the wordpress-site is located in a subdirectory. I followed the steps indicated here: codex.wordpress.org/Giving_WordPress_Its_Own_Directory to set it up correctly.
Link to the site: http://www.luchtspin.nl
Something strange I noticed at the same time: the h1 'Luchtspin' (next to the logo) acts like a link, although it is not a link anymore (it was a clickable div before). It returns the same 404 page. I have several caching plugins installed, but all are deactivated long ago.
Any help greatly appreciated, I've been at this for days now.
Upvotes: 0
Views: 282
Reputation: 8020
KahWee Teng is right, chechk your javascript ( probbly the one that is reponsible for thebrandlogo.svg spin ). It tries to overwrite your url, but, since it has no value, it just prints out "undefined".
The bottom works because it is a plain link.
Upvotes: 0
Reputation: 5306
The problem seems to be on the selector you have used on line 18 of script.js. you were selecting div#branding which has an undefined .href property. Changing the selector to something like #branding a
should resolve the error.
Upvotes: 1
Reputation: 14178
One of the JavaScripts is acting up. It appends the word 'undefined' at the back of your URL. Is there any JavaScript that you use that might alter the URL?
Upvotes: 0