I have a custom walker for my WordPress navigation. I am trying to make a one page wordpress site but I ran into trouble trying to get single pages working so I decided to just go ahead and reload the page to display the single pages. So my custom walker adds characters to the navigation to make it work. So it looks like this
In terms of the hash not being removed when you go to another page, I think you need to reset it back to null in your JavaScript if there is a query string in the URI. For example:
I have a custom walker for my WordPress navigation. I am trying to make a one page wordpress site but I ran into trouble trying to get single pages working so I decided to just go ahead and reload the page to display the single pages. So my custom walker adds characters to the navigation to make it work. So it looks like this
http://mysite.com/#!/post1
When I click on a permalink, it changes to the standard link
http://mysite.com/?p=post1
My problem is that when I try to go to another page, the old address does not go away. So instead of getting
http://mysite.com/#!/about
I get this
http://mysite.com/?p=post1#!/about
my custom walker http://pastebin.com/Xn7NRiG7
On a side note. Does anyone know of any tutorials on making a one page wordpress site? I have been finding it to be very difficult.
In terms of creating a WordPress site without page reloading (using
window.location.hash), check out: http://css-tricks.com/video-screencasts/81-ajaxing-a-wordpress-theme/.In terms of the hash not being removed when you go to another page, I think you need to reset it back to null in your JavaScript if there is a query string in the URI. For example: