Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

image alignment not working as expected #1237

Closed
jturmelle opened this issue Feb 26, 2018 · 11 comments
Closed

image alignment not working as expected #1237

jturmelle opened this issue Feb 26, 2018 · 11 comments
Labels

Comments

@jturmelle
Copy link

jturmelle commented Feb 26, 2018

How can this bug be reproduced?

  1. Create a post. Insert an image, with a caption, and align center

What did you expect to happen?
I expected the figure and image to be centered and the caption to be the same width of the image, which is what happens in the preview.
screen shot 2018-02-26 at 4 44 14 pm

What happened instead?
Image is left-aligned with caption spanning the whole line.
screen shot 2018-02-26 at 4 46 10 pm

Please List the Following:

  • OS & version: CentOS 7.3.1611
  • Node version (node -v) [Node v4+ is required] : v6.9.4
  • FoundationPress version (see line 3 in package.json): v2.10.4
  • Foundation version (found in node_modules/foundation-sites/package.json) : 6.4.3

Sorry, I'm not sure how to do this properly within a codepen or jsfiddle, since it depends a lot on the combination of wordpress and foundationpress.

@JPOak
Copy link
Contributor

JPOak commented Feb 26, 2018

This is sort of interesting. This looks like it has to do with the filter "img_caption_shortcode" in cleanup.php . On line 25 if you comment out this line your images will probably work as expected.

@colin-marshall @olefredrik Is this needed anymore? The function attached to it looks old.

@colin-marshall
Copy link
Collaborator

@JPOak the purpose of that filter is to:

// Remove inline width attribute from figure tag causing images wider than 100% of its container

Did you test this with the filter removed and images that are wider than the container?

@JPOak
Copy link
Contributor

JPOak commented Feb 27, 2018

@colin-marshall I am not seeing any difference when I add an image of 2000px to the default FP template for a page. The _global for images is set to max-width: 100% . I'm just wondering if this stuff needs these function overrides now.

@colin-marshall
Copy link
Collaborator

If images larger than the container are staying 100% width of the container with that filter removed then I see no problem with removing the filter. It serves no other purpose that I can tell.

@JPOak
Copy link
Contributor

JPOak commented Feb 27, 2018

@jturmelle if you get a chance just comment out the line I mention above. It won't destroy anything, but I think it will fix your problem. Let us know. I tested with theme testing data and it looks fine.

@jturmelle
Copy link
Author

jturmelle commented Feb 27, 2018 via email

@colin-marshall
Copy link
Collaborator

@jturmelle did you try to debug with the inspector?

@jturmelle
Copy link
Author

jturmelle commented Feb 27, 2018 via email

@jturmelle
Copy link
Author

jturmelle commented Feb 27, 2018 via email

colin-marshall added a commit that referenced this issue Mar 15, 2018
Fix image alignment bug discussed in #1237.
@pyrodie18
Copy link

Is this closed out now @colin-marshall ?

@colin-marshall
Copy link
Collaborator

Yup. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants