Raw Code Appearing on Huntt Theme
Quick summary
- The Huntt theme is both Premium and retired
On the default Home page (showing recent posts), raw code appears at the top of the page.
Steps to reproduce
- Switch to Huntt theme
- On live site, Posts page (or Home page if set to show most recent posts) scroll down so that the top of the page is no longer visible, then scroll back up.
- Raw code will have appeared at the top of the page.
What you expected to happen
I will be able to scroll up and down the posts list without additional effects
What actually happened
After scrolling down the page, when you scroll back up, raw code appears at the top of the page.
Browser
Google Chrome/Chromium, Mozilla Firefox, Microsoft Edge, Apple Safari, iOS Safari
Context
Customer Report
Platform (Simple, Atomic, or both?)
Simple, Atomic
Other notes
Code which appeared on my simple site, Starter plan:
/* <![CDATA[ */ function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { oldonload(); func(); } } } /* ]]> */
On my simple site, Explorer plan, the same code appeared three times in a row.
During my tests, I found that the code tended to vary from site to site, but in all variations, the above line of code was the one consistent element, though not always at the top or beginning of the code section.
Reproducibility
Consistent
Severity
Some (< 50%)
Available workarounds?
Yes, difficult to implement
Workaround details
If the site is an Atomic site, they should be able to go to Jetpack > Dashboard, then scroll to Theme Enhancements. There the 'Infinite Scroll' can be updated to 'Load more posts using the default theme behavior', which switches the user to a paginated posts display, and the page can't scroll down far enough to trigger the issue.
However, this is not an option on Simple sites, and turning off infinite scroll does not help, as the new posts load in the same page and user will then continue scrolling and trigger this issue.
8562731-zd-a8c
8638510-zd-a8c -- Simple site
Support References
This comment is automatically generated. Please do not edit it.
- [ ] 8562731-zen
- [ ] 8638510-zen
- [ ] 8742904-zen
- [ ] 8757766-zen
- [ ] 9024155-zen
📌 REPRODUCTION RESULTS
- Tested on Simple – Replicated
- Tested on Atomic – Uncertain (I can't find the theme on the Themes Showcase on my AT site)
📌 FINDINGS/SCREENSHOTS/VIDEO I can replicate the issue, and I received similar report from a user.
📌 ACTIONS
- Triaged
Another report with the Huntt theme. 8742904-zd-a8c
Another report here. Huntt theme, simple site. 8757766-zd-a8c
Also reported here, Atomic site. 9024155-zd-a8c
This appears to be caused by Infinite scroll loading all of the <title>, <link>, <meta>, and <script> elements in addition to the expected <article>, and <div> entries, the theme's Masonry implementation then does what is effectively jQuery('script').show() which TIL causes the raw javascript to be displayed on the screen.
Noting this here while I get access to PR it.
@@ -176,7 +176,7 @@
// Reactivate masonry on post load
- var newEl = $container.children().not('article.post-loaded, span.infinite-loader, div.grid-sizer').addClass('post-loaded');
+ var newEl = $container.children('article, div').not('article.post-loaded, div.grid-sizer').addClass('post-loaded');
newEl.hide();
newEl.imagesLoaded(function () {
Fixed via 154548-ghe-Automattic/wpcom-premium-themes