- This topic has 5 replies, 2 voices, and was last updated 3 years, 3 months ago by Tom.
June 27, 2018 at 4:49 pm #610223JANEK
Any advice you could provide in how to achieve this would be appreciated. Sometimes what I believe to be a complicated task is quite easy, but I understand if this is not the case and that I might have to approach a developer on Codeable.GeneratePress 2.1.2GP Premium 1.6.2June 27, 2018 at 8:13 pm #610332TomLead DeveloperLead Developer
I’m not really sure how you would achieve this unfortunately.
Running every request on the site through AJAX likely wouldn’t work.
Maybe post this question over on stackoverflow.com? You might get a couple solutions over there to try out.June 27, 2018 at 8:36 pm #610335JANEK
I did try a plugin called Ajaxify, it allows you to specify the site’s main container to display content and is supposed to keep the rest of the site loaded as you navigate.
Unfortunately it pretty much broke the site as content started piling up and displaying oddly as I navigated to different pages. 😛
Its amazing how much skill and understanding it takes to get functionality that we take for granted when viewing websites.
I might try Stackoverflow and see if someone has an idea over there. Theres things like history.js that I’ve read about but I have no idea how to integrate it my site.June 27, 2018 at 9:04 pm #610345JANEK
On a related note, do you know how to get a div to reload/refresh all its content when a button is clicked. At the moment I have a mp3 jplayer widget in my topbar that only seems to show the current playing jplayer when I navigate to another page.
For example I press play on a mp3 jplayer in the main body of my site, but the topbar jplayer doesnt update to show that its playing. However when I navigate to another page the topbar jplayer refreshes and all of a sudden its inherited the main body jplayers track and its playing. I’m assuming if I had a way to just refresh the topbar div upon clicking the play button in the main body player it would refresh the topbar jplayer to show correctly the playing track without needing to navigate to another page just to update it.June 27, 2018 at 9:22 pm #610350JANEK
I found this PJAX plugin for wordpress:
The instructions say I need to add code to the header, footer and sidebars. Would I do this in the hooks or should I use snippets? If snippets how would I make their code work correctly? My understanding is I put their PHP in those individual hooks it then assigns a fixed state that makes it so those divs/sections dont reload on page navigation.
The instructions seem pretty simple, but I’ll probably find a way to mess it up:
https://github.com/pelmered/wp-pjax#setting-up-the-pluginJune 28, 2018 at 8:56 am #610864TomLead DeveloperLead Developer
It looks like you would need to copy the header.php, footer.php and sidebar.php files from the parent theme. Then add them to your child theme, and add the recommended code.
- You must be logged in to reply to this topic.