Title: Post styling: image dimensions
Last modified: August 21, 2016

---

# Post styling: image dimensions

 *  [Gregory Gainsborough](https://wordpress.org/support/users/gregory-gainsborough/)
 * (@gregory-gainsborough)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/)
 * Hello, I’m working on creating my own theme from scratch. What I’m having trouble
   with at the moment is the images in my posts.
 * Compare:
    [http://www.gregorygainsborough.com/sketchbook/](http://www.gregorygainsborough.com/sketchbook/)(
   a twentyeleven child theme) with [http://www.gregorygainsborough.org/sketchbook/](http://www.gregorygainsborough.org/sketchbook/)(
   my theme-in progress)
 * My problem (should be obvious) is the image size. I _can_ resize images in my
   style.css, (by applying a .img style to a class specified in my loop), _but_,
   because the imported images are all of different dimensions, the resizing that
   works for one image (eg: width:500px; height:300px) will stretch or squeeze another
   image.
 * Twentyeleven is doing something to generically scale the images so they are all
   roughly of the same width, and I’d like to figure out how to do the same.
 * Thanks to anyone who can help!

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/#post-3645492)
 * If you look at the Twenty Eleven functions.php, you’ll find this:
 * if ( ! isset( $content_width ) )
    $content_width = 584;
 * This ensures that all images are no wider than 584px.
    I suspect that your theme
   is missing such setting.
 * When building custom themes, a great starter theme to use is [_s](https://github.com/Automattic/_s/).
   
   It has a really good functions.php with lots of comments.
 *  Thread Starter [Gregory Gainsborough](https://wordpress.org/support/users/gregory-gainsborough/)
 * (@gregory-gainsborough)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/#post-3645514)
 * hi – I added these lines to my functions.php, but in themselves they didn’t change
   anything. Is there some other function or code needed to ‘activate’ this?
 * I’m really still a beginner; this is about where my understanding of wordpress
   breaks up… If you have any resources to recommend for understanding what’s happening
   here, that would be great.
 * I have seen _s and found it a little overwhelming at first, but will check it
   out again.
 *  Thread Starter [Gregory Gainsborough](https://wordpress.org/support/users/gregory-gainsborough/)
 * (@gregory-gainsborough)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/#post-3645517)
 * Ah – I’ve solved my problem at the ‘ground level’ with some css:
    .entry {width:
   660px} (my containing div) .entry img {max-width:100px, height:auto;}
 * BUT, if you’d care to advise me on the functions discussed above, I’m all ears.(
   Teh PhP, it haz sum complicashuns…)
 *  [Christine Rondeau](https://wordpress.org/support/users/crondeau/)
 * (@crondeau)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/#post-3645618)
 * This article has a good explanation of the functions.php file and the $content
   width:
 * [http://themeshaper.com/2012/10/27/setting-up-your-theme-functions/](http://themeshaper.com/2012/10/27/setting-up-your-theme-functions/)
 * The full tutorial is well worth the time investment.
 *  Thread Starter [Gregory Gainsborough](https://wordpress.org/support/users/gregory-gainsborough/)
 * (@gregory-gainsborough)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/#post-3645639)
 * Thanks Christine! I will put my learning cap on.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Post styling: image dimensions’ is closed to new replies.

## Tags

 * [image](https://wordpress.org/support/topic-tag/image/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [resize](https://wordpress.org/support/topic-tag/resize/)
 * [Scale](https://wordpress.org/support/topic-tag/scale/)
 * [style](https://wordpress.org/support/topic-tag/style/)

 * 5 replies
 * 2 participants
 * Last reply from: [Gregory Gainsborough](https://wordpress.org/support/users/gregory-gainsborough/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/post-styling-image-dimensions/#post-3645639)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
