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

    (@dbhynds)

    You may have to pass the markup through a filter as indicated on the FAQ page. It can be hit or miss with galleries, so my suggestion is to just try it out, and also try it with the filter from the FAQ page.

    Anonymous User 14978628

    (@anonymized-14978628)

    You mention in the FAQ changing

    echo wp_get_attachment_image($id);

    to

    echo get_lazyloadxt_html( wp_get_attachment_image($id) );

    Which theme file would one typically find and make this change in?

    Plugin Author dbhynds

    (@dbhynds)

    It depends on your theme. If the slideshow is on your homepage, I’d start with that file. This ought to be helpful it figuring which template files to check: https://developer.www.ads-software.com/files/2014/10/template-hierarchy.png.

    Anonymous User 14978628

    (@anonymized-14978628)

    Very useful infographic, thanks!

    Could you tell me if this plugin supports srcset attribute? I have srcset added to my responsive images and would like to lazy load the image while keeping srcset.

    Plugin Author dbhynds

    (@dbhynds)

    I know… I reference that graphic constantly!

    The plugin does support srcset attributes, so you’re good there.

    Anonymous User 14978628

    (@anonymized-14978628)

    ok, looking at my code the plugin appears to be working on main post content with srcset added. The only thing is when i scroll the page the images don’t fade in as i would expect with lazy loading?

    The code i see for my image is:

    <img data-lazy-tag="img" srcset="https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-150x75.jpg 150w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-212x143.jpg 212w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-330x230.jpg 330w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-400x284.jpg 400w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-479x240.jpg 479w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-627x376.jpg 627w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-686x490.jpg 686w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-768x384.jpg 768w, https://127.0.0.1/wordpress/wp-content/uploads/2016/06/1-981x491.jpg 981w" sizes="(min-width: 768px) 981px, (min-width: 686px) 768px, (min-width: 627px) 686px, (min-width: 479px) 627px, (min-width: 400px) 479px, (min-width: 330px) 400px, (min-width: 212px) 330px, (min-width: 150px) 212px, 150px" class="size-medium wp-image-54 aligncenter" alt="1" width="981" height="491">
    Anonymous User 14978628

    (@anonymized-14978628)

    Forgot to mention, i was only able to get the srcset added by enabling “Enable script-based tagging”

    Plugin Author dbhynds

    (@dbhynds)

    Ahah. It looks like the image isn’t self-closing. In order for the plugin to work, you need to be writing your HTML as well-formed XML.

    So, while this is permissible in HTML5:

    <img src="cool.jpg">

    In order for this plugin to work, it needs to look like this:

    <img src="cool.jpg" />

    (The closing trailing slash is the key.)

    Anonymous User 14978628

    (@anonymized-14978628)

    Is this something i can do as a regular user without knowledge of designing themes?

    Plugin Author dbhynds

    (@dbhynds)

    I mean, if you see somewhere in your theme where the image tag isn’t self-closing, it’s probably safe enough to add the slash. That said, it’s always good to have a test environment and backups if you’re not confident. It really just depends on your comfortability. If in doubt, hire a pro!

    Anonymous User 14978628

    (@anonymized-14978628)

    I am somewhat familiar with php and editing my theme. I also have a local test site which i can use for such things.

    I know all themes are different, but would you be able to give me a pointer as to what to look for and where? I know you said to close the img tag, and i understand what you mean, but i can’t seem to find anything like that in my theme template files. This wouldn’t be in my css would it? As that seemed to do with just styling.

    The template for my posts is called single-post.php, and that is used for posts alongside header.php and footer.php. Would it be something within these files i would be looked for? Or am i looking for a php code of somekind elsewhere?

    Any pointers to get me in the right direction would be great. Thanks.

    Anonymous User 14978628

    (@anonymized-14978628)

    Just a quick update. I’m still working on resolving this issue, but I noticed that with the default Twenty Sixteen theme the images also do not lazy load.

    Are you saying that this is a theme specific issue or a wordpress issue? As it seems strange that this plugin will not work with a default wordpress theme. Surely there must be some way to accommodate this so more users could benefit from this plugin?

    Anonymous User 14978628

    (@anonymized-14978628)

    Got this working. Not sure why it wasn’t working before but it’s working now.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Does it work with WordPress native galleries?’ is closed to new replies.