How can I make all post image uploads have data-width and data-height attributes automatically by default?
Yes you can. See my working fiddle here: http://jsfiddle.net/MonkimoE/0wtgm8a1/ You need to add an id. example: <img class=”img” id=”imageid”….. Delete all atribute “data-width” and “data-height”. because it will added automatically. Add this javascript: (you may change the ‘$’ to ‘jQuery’ if doesn’t work with your theme) <script> var img = document.getElementById(‘imageid’); var width = img.naturalWidth; … Read more