Home Page Slideshow - blank slide
Hero slideshow seems to have a blank slide at the beginning:
<img alt='css.php' src="https://commons.gc.cuny.edu/wp-content/plugins/cookies-for-comments/css.php?k=56432b1df3e67e3f4dcdbad943087b&o=i&t=224126708" width='1' height='1' /> <div class="slide first_slide">
#1 Updated by Boone Gorges 19 days ago
- Status changed from New to Assigned
- Assignee changed from scott voth to Raymond Hoh
- Target version set to 1.15.3
Thanks, Scott. This stems from Ray's fix in https://redmine.gc.cuny.edu/issues/11453#note-7. The Cookies for Comments image was being triggered for the very first WP_Query loop on the page, which in the case of the homepage appears to be the hero slider. I made a quick change in https://github.com/cuny-academic-commons/cac/commit/e02df374165ecbef0c0d04b60b5bd9e7d6a78322 that limits the loop_start and loop_no_results callbacks so that they only add the image if we're in the main query. I believe this will avoid problems like this more generally, but it definitely needs review from Ray :)
#3 Updated by Raymond Hoh 16 days ago
Good catch, Boone.
The main query limitation was something I considered, but thought it would be better to open up the restriction so the Cookies for Comments asset had a better chance of being rendered before the footer.
Currently, if you check the Cookies for Comments asset on the
historyprogram.commons.gc.cuny.edu site (the site referenced in #11453), the asset is now loaded in the footer instead of before.
Maybe, instead, I can check the post type and bail if the post type matches
#4 Updated by Boone Gorges 16 days ago
I'd considered the 'slide' blacklist, but it seems like this leaves us open to whack-a-mole for other similar problems.
That being said, this is a very specific problem to the homepage slider plugin, which parses body content for img tags. This is very unusual, and is unlikely to arise in many other cases. So maybe the blacklist is OK.
Happy to go with whatever you think best.