Like many other WordPress theme’s, mine uses the wonder that is custom fields. It uses it for all those lovely images you see on the front page and in various other positions across the site.
The only problem is, actually populating and using those custom field’s can be hassle, especially for user’s that im trying to get started on posting…the first thing i do is baffle them with how to get the path for an image so they can paste it into a custom field.
So, i asked and searched around and nobody seemed to have an answer for me. I then proceeded to start hacking away and have now managed to add a “Thumb URL” inside the upload tool which can be used for copying/pasting into the custom field of your choice.
An example can be seen on the right.
Want to implement this for yourself?
It’s really pretty simple once you know where to look, but to be on the safe side make a backup copy of the media.php file before you start editing it so you can always revert back should something go horribly wrong.
- Find and open /wp-admin/includes/media.php
- Find the following area of code:
- Add the following line above </thead>:
- Save the file, your code should now look like this:
<thead class=’media-item-info’>
<td class=’A1B1′ rowspan=’4′><img class=’thumbnail’ src=’$thumb_url’ alt=’Thumbnail’ /></td>
<td>$filename</td>
</tr>
<tr><td>$post->post_mime_type</td></tr>
<tr><td>” . mysql2date($post->post_date, get_option(‘time_format’)) . “</td></tr>
<tr><td>” . apply_filters(‘media_meta’, ”, $post) . “</td></tr>
</thead>
<tbody>\n”;
<tr><td colspan=2><br /><label>Thumb URL: </label> ; <input type=’text’ name=’thumburl[$post-/>ID][url]‘ value=’” . $thumb_url . “‘ /><br /><br /></td></tr>
<thead class=’media-item-info’><tr><td class=’A1B1′ rowspan=’4′><img class=’thumbnail’ src=’$thumb_url’ alt=’Thumbnail’ /></td><td>$filename</td></tr><tr><td>$post->post_mime_type</td></tr><tr><td>” . mysql2date($post->post_date, get_option(‘time_format’)) . “</td></tr><tr><td>” . apply_filters(‘media_meta’, ”, $post) . “</td></tr><tr><td colspan=2><br /><label>Thumb URL:</label> <input type=’text’ name=’thumburl[$post->ID][url]‘ value=’” . $thumb_url . “‘ /><br /><br /></td></tr></thead>
<tbody>\n”;
That’s it, you’re done! If you have any suggestions or questions/comments, please feel free to leave them below.

line 1151 if that helps…