Custom HTML not reloading on AJAX navigation
-
Hii !
I'm using Laytheme and I've added a custom HTML div in the "Custom HTML at top" section of my homepage. It contains two images that fill the viewport on desktop.
The issue is that when I navigate through the site using AJAX navigation and then click on the site title (logo) to go back to the homepage, my custom div doesn't appear. I have to do a full page reload to see it again.
I assume this is because the custom HTML injected at the top of the body is not re-injected when AJAX navigation occurs.
Is there a way to disable AJAX navigation site-wide, or is there a hook/event I can listen to in order to re-inject my custom HTML after each AJAX page load?
Thanks in advance for your help!
-
so I can't really review this without a link to your website. I would need a link to your website.
If you just want some content on top of your whole website on all pages, you could also use this feature called "Fixed Header"
Which you can enable in Lay Options in the extra features section
If you just want fixed content on top of your front page, you can click a row on your front page to select it. Then in the sidebar, click Fix ROW.

Other than that, if you have custom HTML in Lay Options, custom CSS and HTML, yes, that is HTML that should be there everywhere on your whole website.
Now it depends on what that HTML looks like, maybe some JavaScript you have or something, because usually this HTML should be everywhere, not just on one page. Maybe it has to do with CSS. I don't know. I can't debug this for you without a link to your website.
-
Hey, thank you for your help. Here is the link to my website :
You will notice that I have 2 images on the home page adapting to the viewport size. I couldn't manage to do this with laytheme so I added code. My problem is : it is working perfectly until I browse the website and click on "Anaïs Fernon" at the top left of my website to go back to the home page : I do land on the home page, but my HTML disappears, so I no longer see my two featured images; I only see the content that's supposed to be below them.
Do not hesitate if this isn't clear. Thank you very much
-
I just realized I have the same problem for my menu and website name, because I used HTML to control this as well. What is weird is it worked perfectly before I added code for my 2 viewport images of home page
For paid 1-on-1 Lay Theme Coaching, contact Audrey (audrey@cyberslayers.work) or me (info@laytheme.com).
We also code custom websites or bespoke Lay features. Drop me a line at info@laytheme.com or check out my work at arminunruh.com.
Want to support my work? paypal.me/arminunruh
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it