Author: topher

Creating a new image size

Recently I found the need to make a new image size in WordPress, other than the usual “Thumbnail”, “Medium”, “Large”, and “Full”.

It’s not very difficult, you simply need to use the function add_image_size in your theme function file, a custom plugin, or an mu-plugins file.

It takes 4 options, 3 are required.  The first is the name of your new size.  This will never be front facing, so use something code-friendly.  Mine was homepage-slide.  Then it takes width and height.  The fourth parameter is whether you want to actually resize the original, or crop it to your new size.

My code looks like this:

if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'homepage-slide', 640, 427, false ); //( NOT cropped)
}

An additional problem that I ran into is that the client had already uploaded about 300 images.  This meant I needed to re-process all of them.

There are several good plugins that do this, but most of them want to do all of your images in one php run, which would time-out for me, since I had so many.

The plugin I used is called AJAX Thumbnail Rebuild. Rather than one big resize call it uses AJAX to make an individual call for each image.  It went through all 300 of my image no problem and then that image size was available to my code.

June Meeting update

Our first meeting was on June 30 at Mutually Human Software and we had about 20 people show up.  We did introductions and talked long about what we wanted from the group and how it would work.

At this point our plan is to meet the third Thursday of every month.  We’ll have one or two main topics as well as have 2-3 people talk briefly about whatever plugin is amazing them at the moment, and wrap up with open conversation.

Kevin Behrens spoke briefly about Role Scoper and Revisionary, describing what each do.

We wrapped up by having open conversation so people could start interacting.

All in all I think it was very successful, and I’m really looking forward to next month’s meeting.

Next Month

Next month’s meeting is also at Mutually Human Software on 21 July.

Brian Richards and Luke Rumley are going to talk about the WPStartbox and Genesis theme engines, and Kevin Behrens will talk some more about Roles.

Introductory Survey

I set up a surveymonkey survey to help prep for meeting formats etc.  I’m also trying out the new “embed” option they offer, we’ll see how it goes.

Please fill out the form below.

Post Ordering

Pages can have an hierarichal ordering.  When you’re editing or creating a page, there’s a box in the bottom right for the page order.  It’s simply numerical, with lower numbers rising to the top.

Ordering your pages by editing every one and getting the numbers in the right order is tremendously tedious.  Several very clever people have created plugins to allow you to re-order your pages with a slick javascript drag-and-drop system.

Today I needed that for a custom content type I created, so I went hunting for a plugin that would handle custom content types as well.  I tried about 5 before finding one that wasn’t buggy and worked the way I liked.

The best one I found is called Simple Page Ordering. The others all added a whole new UI to WordPress, where you’d go to to another page and drag them around and then press save. SPO instead allows you to drag them around right on the Pages page, and saves when the drag is done. That speeds things up quite a bit and greatly minimizes the UI.

It also works swimmingly on all my custom content types out of the box.

All in all I’d say it’s just about perfect.

The official page for the plugin is http://wordpress.org/extend/plugins/simple-page-ordering/.

The WordPress site for it is http://wordpress.org/extend/plugins/simple-page-ordering/