Can you code WP to resize pics automatically?

I’ve got a Wordpress mystery: I used a theme a few years ago that would automatically resize images. For example, I could upload a 800px image and the theme would display it as the width of the blog post area (600px). Now I can’t locate that theme and I’m wondering how it did the resizing. I don’t think it was CSS… CSS can’t display an image in another size (or can it?). I’m thinking it was something in the functions.php file.

By the way, I realize the Media settings in WP can lock in custom image sizes for thumbs, medium and large images… what I’m referring to was done strictly by the theme itself.

Anyone know what I’m talking about?

Re: Can you code WP to resize pics automatically?

[QUOTE=msm;80704]I’ve got a Wordpress mystery: I used a theme a few years ago that would automatically resize images. For example, I could upload a 800px image and the theme would display it as the width of the blog post area (600px). Now I can’t locate that theme and I’m wondering how it did the resizing. I don’t think it was CSS… CSS can’t display an image in another size (or can it?). I’m thinking it was something in the functions.php file.

By the way, I realize the Media settings in WP can lock in custom image sizes for thumbs, medium and large images… what I’m referring to was done strictly by the theme itself.

Anyone know what I’m talking about?[/QUOTE]

Actually yes, I actually do know what you mean. Don’t faint, it shocked me too lol
If I am right, they use a jquery adaption, or some other similar program, and I have a few themes that do that. I’ll have to check them to see which it is, as my memory is bit off today think it’s called old age :bang:

Re: Can you code WP to resize pics automatically?

[QUOTE=Gaystoryman;80705]Actually yes, I actually do know what you mean. Don’t faint, it shocked me too lol
If I am right, they use a jquery adaption, or some other similar program, and I have a few themes that do that. I’ll have to check them to see which it is, as my memory is bit off today think it’s called old age :bang:[/QUOTE]

check out timthumb I think that is the most common one used to automatically resize the images for themes, that use images on the front page. Least that’s the page I see in the themes that do it for me. HalfCircle is one of them as is NaturalPaper. both seem to use timthumb.php and I would imagine, contain something in the functions.php to make it all work. But check those two themes out, for a glance at how maybe it works.

Re: Can you code WP to resize pics automatically?

Thanks guys. I also got an email from a friend who said that CSS can do this. He told me to enter this code in my style.css file:

p img{
max-width: 100%;
}

That apparently will scale the image to whatever width my post container is set at. I’ll have to try it to see if it works.

Re: Can you code WP to resize pics automatically?

To avoid a distorted image use the code below to automatically scale the image height to it’s width:

p img{
max-width: 100%;
height: auto;
}

ref