jelu
jelu

Reputation: 57

Clicking on 'home'-logo returns 404 error page

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 &copy; <?php echo date("Y"); ?> <?php bloginfo( 'name' ); ?></a>

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

Answers (3)

Peon
Peon

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

shxfee
shxfee

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

KahWee Teng
KahWee Teng

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

Related Questions