cc licensed ( BY NC ND ) flickr photo shared by Reema

This blog’s crusty old theme (I still like it, sue me) has a pretty narrow width content column, 500px fixed. I typically size my media to fit. Since I have been syndicating content into here from my other blogs– my Barking Dog photo site puts images in at 950px wide, and my ds106 tricks site is at least 800 wide, I end up with posts requiring manual editing.

Here is an example, the post originally at ds106 tricks has images 71- px wide, so when they are syndicated here, I get cruft like:

(click image to see it big-ola)

(click image to see it big-ola)

yeah, click the screen shot to see it larger

yeah, click the screen shot to see it larger

The images blow wide, at the top its not horrible, they are behind the sidebars… but it bothers my design sense.

I’ve noticed on themes like the stock WordPress Twenty-Eleven -Twelve, -Thirteen that it seems to magically size all images wider than the column width to fit.

I dug into the CSS and found the classes are setting a max-width for images in the content column to 97.5%. That is easy.

So I added this code to me blog’s CSS:

You have to put a maxsize on the caption class because that is the one that decides the space usage if a caption is added in the WordPress editor.

Now I was lucky because my theme names the div that contains the main column content is

same as the Twenty- themes. You might have to root around your single.php template or peek at the source code, because theme designers can name they divs all kinds of goofy names.

Anyhow, it seems to be working:

image fiits

image 2 fits

But I am sure it will gunk up somewhere else. And I still have challenges where the RSS feeds seem to not include the embedded video, but a thumbnail linked back to the post.

It’s always something… if it’s not one thing it’s another.

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *