Show image exactly defined to a width
I have a photoblog displaying posts as image galleries having width 500px and some posts as single image of width 900px. For posts with 900px width images, I made category HQ
.
Posts with 500px width image galleries display fine. But those posts having single image doesn’t display image of width 900px width instead 584px. E.g. Post content for 900px width image:
<img class="alignnone size-full wp-image-15735" alt="Camping in the Rocky Mountains " src="http://abc.com/wp-content/uploads/2013/05/Camping-in-the-Rocky-Mountains.jpg" width="900" height="700" />
Getting image info in browser shows 584px width. On further inspection, I came to know that there is a $content_width variable
in functions.php
set to 584px. I can’t change it as I read it is for oEmbeds.
How to get this 900px width image to show as 900px width?
If
$content_width
is the problem, you could set it to something different if you’re viewing a single HQ post.This assumes that the
$content_width
variable is global.See the Codex pages for
is_single()
&in_category()
for more information.To add to @Pat’s answer above. Try to add this to your CSS.
Sometimes thats all it takes