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.
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 ashould resolve the error.