WordPress.org

Ready to get started?Download WordPress

Forums

image tags creating bizarrely arbitrary height and width attributes (2 posts)

  1. boykenan
    Member
    Posted 2 years ago #

    Site in question: http://www.actnowny.org/5016/daily-visual-stop-frisks-booming/

    In my media settings, medium size images are set to be 586px wide. Normally, the WordPress-generated image tags include a 'width="586"' attribute. But if that image is inside a caption, WordPress instead decides the image should be 527.4px. (It then calculates the the +10 caption width accordingly, making it 537 px.)

    On the page linked above, the generated code looks like this:

    <div id="attachment_5019" class="wp-caption aligncenter" style="width: 537px"><a href="http://www.nyclu.org/node/1598" target="_blank"><img class="alignnone" src="http://www.actnowny.org/wp-content/uploads/2011/11/Slide1-586x439.jpg" alt="Stop & Frisks in NYC by Race" title="Stop & Frisks" width="527.4" height="395.1" class="size-medium wp-image-5019" /></a><p class="wp-caption-text">Data from NYCLU</p></div>

    Where is it getting 527.4 from? And how can I change that to a more appropriate size?

  2. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic