Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End wordpress nav issue (advanced)

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42864
    cybershot
    Participant

    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.

    #125437
    tomrogers123
    Member

    In terms of creating a WordPress site without page reloading (using `window.location.hash`), check out: https://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:

    if(window.location.pathname.indexOf(‘?p=’) != -1) {
    window.location.hash = null
    }

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.