Manipulating browser history with WordPress

I’ve implemented this script https://codyhouse.co/gem/animated-page-transition/ to WordPress which allows me to load some of my pages dynamically.

The loading of new pages works fine. The only thing I can’t figure out is how to adjust window.history in the way that it works inside WP. If I click back button in my browser the page returns correct slug but the loaded content is empty.

I’m using:

var newSection = 'cd-'+url.replace('', '') 

instead of

var newSectionName = 'cd-'+url.replace('.html', '') 

as given in demo. Any idea how to implement it correctly inside WordPress?

Read more here: Manipulating browser history with WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *