LLXT breaks blog layouts in certain themes (quick fix inside)
-
Hi.
For those who use multi-column non-“table” blog layouts, LLXT (and any other lazyload solution) COULD break normal flow of post cards. To render full page correctly in this type of layout, browser needs to know real image sizes. With LLXT activated, browser “knows” sizes for currently visible (top) images only, rest of them it thinks are 1×1 px (or some other size, depending on browser), and when you scroll down, cards probably will be messed up.
There are two ways to do it correctly. One of them (and best) is used in “Image lazy load” by WPcube, which is based on Unveil. I am not really good JS/PHP coder and can’t recognize how they done it, but result is good – all the placeholders for pictures, which are not yet loaded, have actual (real) sizes. No “jumping” effect, when tall image can “throw down” text under it when it loads.
Okay, back to subject. To quickfix layout breakdown, just add bold code to your lazy-load-xt.php:
function filter_html($content) {
if (is_feed() || is_preview()) {…This will turn off LLXT for some themes’ blog page layouts, where css classes exclusion does not work.
- The topic ‘LLXT breaks blog layouts in certain themes (quick fix inside)’ is closed to new replies.