• Resolved Aldo

    (@ab_lu)


    Hi Stefan

    When validating the HTML code of our site we get the following error:

    Error: Element img is missing required attribute src.
    [endif]–><img srcset=”/wp-content/uploads/2016/05/image-165×120.jpg, /wp-content/uploads/2016/05/image-330×240.jpg 2x” class=”lazyload img-responsive” alt=””>

    Is there a way to add an empty src using rwp_picture?

    Thanks
    Aldo

    https://ww.wp.xz.cn/plugins/responsify-wp/

Viewing 1 replies (of 1 total)
  • Plugin Author stefanledin

    (@stefanledin)

    Hi Aldo!
    You have two options.
    1. Turn on the native mode. The <img> will have both the src and srcset attributes then. The downside of this is that browsers that doesn’t support srcset might download two images, the one in the src and the one from srcset that fits best.
    2. I haven’t tried this, but I think it should work:

    echo rwp_picture( $id, array(
        'attributes' => array(
            'src' => ''
        )
    ) );
Viewing 1 replies (of 1 total)

The topic ‘HTML Validation issues’ is closed to new replies.