• 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.

    https://wordpress.org/plugins/lazy-load-xt/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dbhynds

    (@dbhynds)

    Thanks for the suggestion and sorry for the delay.

    So … is_preview() … when does that return true? Is that when you preview an unpublished (draft) post?

    Thread Starter sexymazafaka

    (@sexymazafaka)

    Normally yes, it should return true when you preview drafts, but during many experiments I found that on some themes it returns true on blog pages (where blog posts are listed, not inside articles). Depends on how that pages are rendered. I got this issue on some premium themes, Melos Pro for example, and some others, which has ‘cards’ blog layout pages. Check poznamka.com homepage for example.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘LLXT breaks blog layouts in certain themes (quick fix inside)’ is closed to new replies.