How to Change Maximum Width for Existing Posts

Community Forums Forums Design Tips and Tricks How to Change Maximum Width for Existing Posts

This topic is: not resolved


This topic contains 2 replies, has 2 voices, and was last updated by  William 2 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #3854



    I’m migrating from a site from ProPhoto Blog theme to a Genesis theme (probably Streamline). One of the issues I’m facing is that the existing posts used a larger image width than the Genesis themes use, so I’m seeing images extend beyond the blog area into the sidebar.

    The images were uploaded at 1200×800, but the Large media setting was up to a 900px width. I’d like to know if there’s a simple way to change the maximum width for existing posts to fit the dimensions of the smaller Genesis content area?

    I did some research and found some CSS code snippets that claim this is pretty simple with code like this example:

    .postContent img {
    margin: 10px;
    border: 3px solid #CCC;
    max-width: 500px;
    width: expression(this.width > 500 ? 500: true);

    Of course, it didn’t work when I pasted it into the CSS stylesheet. I figure it’s close to what I need, but I lack the understanding to tweak it to do as I need with Genesis.

    Anyone have a suggestion? Thanks.



    Genesis uses a different class for the content…try this instead:

    .entry-content img {
    max-width: 500px;

    John Sundberg |
    A WordPress developer’s toolbox: Firebug | WordPress Codex | Google ;)



    Thanks, John.  That works!  The only exception is for photos with captions that still move over into the sidebar, but it’s not due to the size of the image.  I have another routine to eliminate the captions, so it’s all good from here.

    Again, many thanks. That’s much better than having to touch all of those old posts manually.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.