Support » Fixing WordPress » Expanding Post to Fit Image

  • I just started using a new theme, RedBel, and it looks great. However, when I add images that are longer than the post text, they flow out of the post box.

    That is the best example that I have. When the text is longer than the image, the post box automatically expands to accommodate it. Does anyone know how to edit the css to make is so that the post will expand to fit images?


Viewing 3 replies - 1 through 3 (of 3 total)
  • Joe Ponzio


    Your image is being floated to the right and it is not cleared. (If that doesn’t make sense, don’t worry — read on for the fix.)

    You content is held in a div with a class of article-page-contents

    <div class="article-page-contents">

    When you post your image and align it to the right, you need to “clear” it before closing the article-page-contents div.

    Just before the closing div for the article-page-contents, but after all of your text and images, put this:

    <div style="clear: both;"></div>

    That will put your site back into the “flow” and extend that container past your picture.

    Awesome, thank you so much. I have another question that maybe I can answer myself if I just sit down and read a bit about css, but i’ll try here.

    Where is that div class being assigned? I don’t see it showing up in the html for my post, so i’m assuming that it is in the style sheet? I will try to located it myself in the meantime, although I don’t know if there is anything I can do about it other than adding your suggestion to the posts that need it.

    Thanks again.

    Joe Ponzio


    It will be in one of two places:

    1. in one of your theme files (like single.php), or
    2. in the plugin or function that generates the output for the page

    I can’t tell exactly as I can’t see your theme and what plugins you’re using.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Expanding Post to Fit Image’ is closed to new replies.