-4

A couple of days ago everything was good, but now the image is not displayed in full-size. This seems like an old bug.

Here's what failed to me:

  • Adding a custom CSS: img .size-full {width:900px;}
  • Adding <?php $content_width = 900 ?> to my theme's functions.php file
  • Looking at wp-includes/media.php, but cannot find $max_width=500
  • Using the plugin Regenerate Thumbnails to regenerate the thumbnails
  • Uploading the images via FTP

I don't have this problem with another site. Is this because of the host? I would like to know what is happening, and how to fix it. The link to the page that has an image that cannot be in full-size is here.

  • You should be a bit more specific. Under what circumstances won't full size image show? What is the php code that is supposed to generate this image? Is any javascript or a plugin involved? – cjbj Aug 13 '16 at 15:40
  • Not enough information for us to go on. CSS is invalid, Can you show more code. – Sisir Aug 13 '16 at 15:58
  • @cjbj I don't know. I set everything up fine, then suddenly this appears. Where I can find that php code? – Ooker Aug 14 '16 at 5:52
  • @Sisir what code are you looking for? – Ooker Aug 14 '16 at 5:52
  • Sorry, but without knowing the relevant code (or even a link to the site in question) we here can do nothing but offer wild guesses. – cjbj Aug 14 '16 at 10:07
2

Just a guess, but img probably does not have a child element with the class size-full. The class is probably on the img itself. So it should probably be img.size-full without a space. Which would make this a CSS problem and not a WordPress problem.

  • it doesn't work – Ooker Aug 14 '16 at 5:02
  • ¯_(ツ)_/¯ that's all I can do with the info you provided. – Florian Aug 14 '16 at 5:12
2

Visiting your site I must conclude that this is a simple case of wrong css (and hence not a WordPress problem).

You have all your content in a div with class container. In your bootstrap.min.css you set the width of this container as 1170px. In style.css you define max-width:100% on images. So no matter how you define the width of your image, it is always scaled so it fits into 1170px.

  • so should I edit the bootstrap.min.css, or the style.css, or use a custom css? And for the sake of knowledge, where should I find the php code? – Ooker Aug 14 '16 at 13:37
  • The php is somewhere in your theme files. If this is not your own theme you should make a child theme to put your changes in. – cjbj Aug 14 '16 at 13:39
  • thanks, but is there a quick (and safe) way to do the fix instead? – Ooker Aug 14 '16 at 13:40
  • The quick and dirty one is editing the css files. – cjbj Aug 14 '16 at 13:41
  • But if the theme is updated you lose your edits. – cjbj Aug 14 '16 at 13:42
1

img .size-full {width="900";} is not valid CSS. Use either img .size-full {width:900px;} for fixed site/exact width or img .size-full {max-width:100%;} for fluid/responsive

Update, as per Florian, and of course remove the space as well, as img is an "empty" tag - no descendant possible: img.size-full

1

It's not amazingly obvious from your question which images you are talking about but I would suggest that if it is all images in the content of the page linked too that you simply add a css rule for it. Something like the following:

.entry-content img { height: auto; width: 100% }

This would force the image to be the same width as it's container and stretch it out to 915px wide on your desktop breakpoint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.