[SOLVED] Tiered menus first level duplicated at 'Not found' page
Hello,
After some extensive Googling I've managed to put together a multi-tiered menu using the wp_list_pages function. It works great everywhere except on the "Not found" page. On that page the code somehow gets it wrong and outputs the first level elements as a subnav/second row, which results in a duplication of the main menu. See code below. Does anyone have a clue to why this is? And how do I resolve it? I thought that maybe a custom 404 template would fix it, but when I put a 404.php in my Atahualpa folder it doesn't get used as I read somewhere it would... The code that goes in header.php looks like this: PHP Code:
|
I would have to see the site to understand what you are doing.
Also it would be helpful to know what version you are running.... |
Hey Juggledad! Thanks for helping out.
Unfortunately I can't show you the actual site since it is not live yet, but in the image below you can see what I'm doing. Does that clarify my problem? http://deom.se/temp/menu-examples.png |
I would add some 'echo' statements in your code so ou can see what is executing, something like
HTML Code:
ehco 'I am in the first if<br>'; |
Thanks for your help Juggledad!
I did some echoing and found out that all the variables for post id and post parent id were not set when you were at the 'Not found' page. So I just made my else into an else if with an isset check in, like below if anyone is interested. PHP Code:
|
All times are GMT -6. The time now is 09:09 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.