Google Groups

Re: [MWUG] Using custom meta boxes to generate the Featured Image thumbnail

Perry Mar 29, 2012 4:50 AM
Posted in group: Manchester WordPress User Group
Cheers Mike - I'm already using these actually, the thumbnails are there on the server.

Unless I set the Featured Image in the post editor manually no thumbnail appears alongside my posts on my archive pages or next to excerpts (see the link at top of this page:

I am using the Prototype theme (based on the Hybrid theme framework) as a parent for my child theme btw, in case this has any bearing.

On Thursday, March 29, 2012 12:25:41 PM UTC+1, Mike Little wrote:
On Thu, Mar 29, 2012 at 11:13, Perry <> wrote:
I've created a custom post type and a custom meta box that accepts a reference number which is also part of a related image file name e.g.:

In the meta box I enter 1993.83.04.09 which relates to the image 1993.83.04.09.jpg

So far I have been able to create a single page custom template that pulls this custom metadata, appends '.jpg' and displays the related image for the post once it is published.

This makes adding images to the custom posts very easy and supports my ultimate aim of bulk uploading all post data via csv.

The only thing is I still have to manually create the thumbnail for the Featured Image by going into the post editor (there will be 1000+ images on the site so I want to avoid this if possible).

Is there any way that I can use the meta box data again to generate the post thumbnail too?


You might be able to use the add from server plugin 
which can be used to point at a folder of images on your server (e.g. after they have been ftp-ed there) and it will add them into the media library. I think it will also generate the thumbnails as it does so too.

If that one doesn't generate the thumbnails, you can use the regenerate thumbnails plugin

Or you could pick apart the latter's code and call the generate code as you need it.

Mike Little