theme development – How can I wrap all blog posts image with

Question

Excellent WordPress programmers, I’d like to resolve an image issue with my WordPress theme. I tried everything I could, but I couldn’t find a solution.

The issue is that my added blog posts images are not responsive. While my feature image is responsive since it has the tag <picture class="c-picture">. If I add <picture class="c-picture"> manual to the images it, fixes it.

Example:

<picture class="c-picture"><img loading="lazy" class="alignnone wp-image-160 size-full" src="https://i1.wp.com/sololoaded.com/wp-content/uploads/2021/06/20210617_164346.jpg?resize=2048%2C2048&amp;ssl=1" alt="" width="2048" height="2048" data-recalc-dims="1"></picture>

So my question is, can I have a function that will add <picture class="c-picture"> to all blog posts images. Thank you, guys. Post link: https://sololoaded.com/nigerian-music-artists-who-were-born-rich/

in progress 0
Godwin 2 weeks 2021-07-20T12:34:55-05:00 0 Answer 0 views 0

Answer ( 1 )

    0
    2021-07-23T05:43:03-05:00

    I think in your case you can do it using css by adding the height: auto; to image tags:

    .c-entry-content img {
        max-width: 100%;
        height: auto;
    }

Leave an answer

Browse
Browse