Page is skewed when no carousel items
-
I noticed the content which the site was currently rendering is output to the buffer early if there are no gallery items.
This was because ob_end_clean(); was being called regardless of whether there were items in the carousel or not. It flushed the content of the current ACF field I was using straight to the buffer and into the body tag of the page.
I made the following changes.
I declare $output just under $images = array();
I moved
$output = ob_get_contents();
ob_end_clean();
to be inside the if(count($images) > 0){ so the flush is only called if the images are being rendered.https://www.ads-software.com/plugins/cpt-bootstrap-carousel/
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Page is skewed when no carousel items’ is closed to new replies.