if you don’t use captions, in place of FIGURE, it uses only IMG tag, and the WIDTH of FIGURE is not there anymore. Anyway I would like using captions for my photos. So, once again : How to fix this issue of FIGURE width being embeded with fixed pixels?
here is a fix por this old issue, meanwhile they change the coder
1- edit functions.php of yout theme
2- add following line remove the fixed WIDTH pixels
add_filter(‘img_caption_shortcode_width’, ‘__return_false’);
Hey @xavierve! I’m glad you found a workaround for this.
In general, you would not want to use the classic editor plugin with a block theme such as TT3 or TT4. In addition to this, your theme should probably have some css to prevent any images from leaking outside the main container, something similar to the following.
.entry-content img,
.entry-content figure {
max-width: 100%;
}
Hi. Thanks for reply.
The classic editor is for an particular author that feels comfortable witthout blocks as he just want to write long texts.
Your CSS fix it for small screens, thanks!
I thought it should be fixed with an !important (to overrule the embeded WIDTH style), but it doesn’t
Actually, TT4 theme just limit container to global (–wp–style–global–content-size 620px by default) not to parent 100%
body .is-layout-constrained > :where(:not(.alignleft):not (.alignright):not(.alignfull)) {
max-width: var(--wp--style--global--content-size);
margin-left: auto !important;
margin-right: auto !important;
}
The problem is now on desktop, FIGURE and IMG are not limited to xxx but to .entry-content width. Can add your css fix for small screens and another with an @media , sure, but…
I think best solution is fixing the root of the problem: when inserting media with caption, a WIDTH on fixed pixels is passed and it shouldnt
[caption id="attachment_53" align="alignnone" width="1024"]
I tried going to HTML Editor to remove such width=”1024″ but it comes back every time I open the VISUAL Editor
regards
Hi @xavierve! It looks like this might be a bug. The best option would be to submit a bug report on Github.
I have the same issue. Any suggestions?
Hey @jesperandreassen! Please start a new topic with your issue. Due to the differences between environments, it’s entirely possible that you don’t have the same issue, and posting your own topic with any needed details will help you get a better answer.
For the issue above, you can check the issue filed on Github for the classic editor plugin.