Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Wrappping text around picture with caption

  1. #1
    MikeCloutier is offline Hello World
    Join Date
    Mar 2010
    Posts
    31

    Default Wrappping text around picture with caption

    The text wrap function around pictures works great except when I want to add a caption to the picture, then the main text drops below the caption text. I would like to find a way to wrap my main text around and image and the caption.

    For example, my main text block is 480 pixels wide and I want to cut in a 120 pixel picture. Without a caption, it wraps nicely, but with a caption, it does not cut into the text block.

    Your advice is greatly appreciated.

  2. #2
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by MikeCloutier View Post
    The text wrap function around pictures works great except when I want to add a caption to the picture, then the main text drops below the caption text. I would like to find a way to wrap my main text around and image and the caption.

    For example, my main text block is 480 pixels wide and I want to cut in a 120 pixel picture. Without a caption, it wraps nicely, but with a caption, it does not cut into the text block.

    Your advice is greatly appreciated.
    Are you using the [caption] shortcode (i.e. the media manager) to add your picture? If so, the wrapping should work just fine.

    If not, you'll probably need to wrap both the image and caption in a container, and then float the container in order to accomplish the desired effect.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  3. #3
    MikeCloutier is offline Hello World
    Join Date
    Mar 2010
    Posts
    31

    Default

    I am using the caption field in the media manager when I insert the image.

    Subsequent to posting my question, I've been looking around in the theme files and wonder if there is something missing in the code.

  4. #4
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by MikeCloutier View Post
    I am using the caption field in the media manager when I insert the image.

    Subsequent to posting my question, I've been looking around in the theme files and wonder if there is something missing in the code.
    You're setting the "floatleft" class for the image, right?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  5. #5
    MikeCloutier is offline Hello World
    Join Date
    Mar 2010
    Posts
    31

    Default

    I am setting alignment for the image, not float class.

  6. #6
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by MikeCloutier View Post
    I am setting alignment for the image, not float class.
    Right - setting that alignment gives the container (or, in case of no caption, the image itself) the "alignleft" (mea culpa, it's "alignleft", not "floatleft") class, that gives the container the float:left property.

    Not sure why it's not working - unless your theme's CSS is somehow overriding that "alignleft" CSS declaration.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  7. #7
    MikeCloutier is offline Hello World
    Join Date
    Mar 2010
    Posts
    31

    Default

    Without a caption, the alignment works great and the text wraps around the image. When I add a caption, the text does not wrap and instead jumps to the first line after the caption.

  8. #8
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by MikeCloutier View Post
    Without a caption, the alignment works great and the text wraps around the image. When I add a caption, the text does not wrap and instead jumps to the first line after the caption.
    Do you have a live example, for code review?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  9. #9
    MikeCloutier is offline Hello World
    Join Date
    Mar 2010
    Posts
    31

    Default

    Here's the view of the picture without the caption
    http://www.ridgewayherald.ca/index.p...ze-says-mayor/

    And here's a sample with the caption. All settings are the same as above. It's password protected because I don't want it publicly available. The password is chip.
    http://www.ridgewayherald.ca/index.php/test-for-chip/

    Thanks for your help.

  10. #10
    MikeCloutier is offline Hello World
    Join Date
    Mar 2010
    Posts
    31

    Default

    I'm wondering if I'm missing a style definition for captions in my theme, and if so, what do I put in?

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •