WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been working on resizing the images on my wordpress website, the images are not appearing on equal sizes or not aligning properly. But inside the product pages it looks normal size but in the shop/home page (products page) all images are appearing in bigger size. how to fix the image size in wordpress i have not idea. Please refer my website (www-dot-carolinegoodwin-dot-com and suggest me what to do and how to fix this issue.

Thanks much in advance for your help.

share|improve this question

closed as off-topic by toscho Jun 28 '15 at 22:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

The CSS of WooCommerce is stretching the images to 100% of their parent <div>, as seen here:

 ul.products li.product a img {
     -moz-transition: all 0.2s ease-in-out 0s;
     box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
     display: block;
     height: auto;
     margin: 0 0 8px;
     **width: 100%;**

You can simply remove or override that line using the !important declaration in another CSS file. Also, you can override it to width: auto and change the margin: 0 0 8px in that rule set to margin: 0 auto 8px auto to center those images in their div container.

share|improve this answer
Thank you for your finding fault and advising. I will work on it as said above and reply with the results. – Murari Oct 5 '12 at 14:08

First of all, make sure your stylesheet is being included properly. In the chrome inspector, I found this:


edit:I replaced the image as I noticed it was hard to read so I zoomed in and took another screenshot.

I'm not to sure if your styles for the images are included in this file or not, but my first stop would be to make sure that everything is being included. Make sure that when you are enqueing the style (as you should) you use get_template_directory_uri() like so:

wp_register_style( 'custom-style', get_template_directory_uri() . '/path/to/css' );
wp_enqueue_style( 'custom-style' );

If this is not the issue, and the styling is being included (and the aforementioned stylesheet is a different one), what I've done in the past is wrote a css to style all images I want to be the same width (with the use of a class or what have you). This doesn't work when WordPress automatically puts in a height attribute directly into the html. In that case, I write a quick jQuery script that searches for all the images on a page and removes the height attribute.


With just a width attribute in the css, the browser should automatically adjust accordingly. However, you would have to include an !important at the end of the css, as inline attributes trump stylesheets.

share|improve this answer
Thank you for your finding fault and advising. I will work on it as said above and reply with the results. – Murari Oct 5 '12 at 14:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.