• I am developing a theme which sticks to a strict baseline grid, in other words, the height of each element on the page has to be divisible by 18 (the baseline).

    I would like to use the wordpress media uploader to manage the images associated with the articles. I have set the max width and height values in the media settings, (there are two widths which remain constant, thumb and large), but how would I go about ensuring that the altered height is divisible by 18?

    Regards, Steve.

Viewing 1 replies (of 1 total)
  • Thread Starter stevecb

    (@stevecb)

    EDIT: This actually isn’t working, a coincidence the resized image was divisible by 18.

    I’ve made some progress with this, its not pretty, but its working-ish.

    I added the following to wp-includes/media.php at ~line 305

    //adhere to basline grid
    	if($new_h % 18) {
    		$new_h = $new_h;
    	} else {
    		$new_h = floor($new_h/18) * 18;
    	}

    This works on the large scale image which is included in the article, but has no effect on the thumbnail image. Any ideas?

Viewing 1 replies (of 1 total)
  • The topic ‘Image height divisable by basline’ is closed to new replies.