Tonight, I was struggling trying to make an image resize dynamically on one of my WordPress sites based on a maximum image width. I thought I would try out some script with jQuery, since WordPress includes it in the core code. Below you will find the code that I used to make it happen, which is based on this article.
Note: This will conflict with the Featured Content Gallery plugin (and probably others, too!). Please let me know if you figure out how to get it working with that plugin! 🙂
Enjoy!
First, make sure you initialize jQuery by calling the following function BEFORE the “wp_head();” function:
Second, paste the following code AFTER the “wp_head()” function call:
3 Comments
More posts from themightymo.com
Reorganize Your WordPress 2.7 Admin Panel with Fluency 2.0
Yesterday I discovered the new Fluency 2.0 plugin for WordPress 2.7. It does a fantastic job of cleaning up the admin interface and makes the back-end WordPress experience much better for users.
We Now Offer Search Engine Optimization!
We have just teamed up with one of the web’s finest search engine optimization gurus, Greg Cryns, and will now be offering his services to you, our customers! For you, our customer, this means that we now have added expertise in driving targeted traffic to your website. Greg has over a decade worth of search…
Adobe CS4 Flash MN Presentation at FlashMN
Below are my notes from tonight’s FlashMN meeting starring Dustin Tauer. The presentation focused on the new features of Adobe Creative Suite 4. Illustrator CS4 Can create multiple art boards. So, if I wanted to use artwork for the front and back of t-shirt, I would create 2 art boards (up to 100). There are…
I’m confused, but impressed! Thanks for sharin’…*kirk
@Kirk – You aren’t alone! This stuff is pretty complex. Thankfully, most of the cool code is available for copy-and-pasting. 🙂
Thanks a lot m8, been searching for a while on how to set the max size of my images, this one worked like charm, kudos :).