Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a products page with a couple child pages and in my footer I have the same product categories as links. All the words do work as links except one and there is no difference in paths and I can if I manually go to my site an into products I can still reach that page but not from clicking the link in the footer, why? I only get to a page doesnt exist although I have the page opened in another tab with the exact same url.

This is my footer.php

        <div id="footer">
        <a href="http://energyshop.se/produkter/art-meditationer/">Meditationer</a>, <a href="http://energyshop.se/produkter/guidade-upplevelser/">Guidade upplevelser</a>, <a href="http://energyshop.se/produkter/vatten/‎">Energirening & Energidroppar</a>, <a href="http://energyshop.se/produkter/clearings-och-aktiveringar/">Clearings m.m.
    </div>
</div>
<?php wp_footer(); ?>

This is the line that doesnt work:

<a href="http://energyshop.se/produkter/vatten/‎">Energirening & Energidroppar</a>

although its the same as the other and as I mentioend earlier its just the link in the footer that doesnt work (takes me to error page) but I can still go into Products and click the image for the same ur and come to the correct page without error?

share|improve this question

closed as too localized by s_ha_dum, kaiser, toscho Feb 1 '13 at 17:15

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
You have some invisible dirt after trailing slash in your invalid link:%E2%80%8E. Also it's a very bad practice to hardcode links. And more, it's not a Wordpress question. –  Max Yudin Feb 1 '13 at 14:38
    
Also, it works when I click that link in your footer. It is missing a trailing slash but that doesn't break the link when I try it. –  s_ha_dum Feb 1 '13 at 14:41
    
Yes I found the "dirt" and got it to work with using dynamic links as shown below, thank you all. But everyone is saying that hardcoded menu is bad practice, but I am not using hardcoded menu? I use the Custom Menu widget under Appearance -> Menu to create and adjust my menu. –  Emanuel Olsson Feb 2 '13 at 17:13

2 Answers 2

It is incredibly bad practice to hardcode urls, almost as bad practice as hardcoded menus.

I strongly suggest you research custom nav menus. It will save yourself a large amount of time in development, and support costs, and it's something to demonstrate to your client to gain kudos.

Hardcoding menus is a major warning sign of poor code, and it reflects badly on you. Having said that not everyone is aware, and I understand this may be new to you, in which case I hope you find it useful.

The Hardcoded Fix

If you really, really, must hardcode things ( and all the little kittens that die as a result ), at least make it dynamic so that if your sites URL changes, so does the link:

<?php echo home_url('/produkter/vatten'); ?>
share|improve this answer
    
Hi thanks fo the reply but I AM using a custom nav menu? And for the hardcoded links in the footer I got them to work with the backslashes but I will change this to dynamic. But this is what the client want, clickable links in the footer, so what would be the best way to solve that? –  Emanuel Olsson Feb 2 '13 at 16:34
    
Why would you not use a nav menu for the footer links? The client doesn't care how you do it, just that it's done –  Tom J Nowell Feb 2 '13 at 20:58

We can't help you without investigating the code behind your theme, but...

... changing the link from http://energyshop.se/produkter/vatten to http://energyshop.se/products/vatten/ works, at least for me :)

The link in Products section also points to /products/vatten/ and then just redirects to produkter/vatten.

share|improve this answer
    
The quoted line above that they said didn't work shows the "/" at the end. –  NTL0820 Feb 1 '13 at 17:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.