Add Post Image Attribution

This document is deprecated! The information on this page refers to a Thesis version that is now obsolete. Please visit the Thesis Docs for current documentation.

On the Edit post panel, at the bottom of the Custom Fields section, click “Enter new”.

In the “Name” field, type image_source, and in the “Value” field, paste the URL you wish to use to link to as the attribution/source.

Click the “Add Custom Field” button; and then the “Publish/Update Post” button.

Then, place this code in custom_functions.php:

function image_source() {
global $post;
$source = get_post_meta($post->ID, 'image_source', true);
  if ($source)
    echo '<p><a href="' . $source . '" rel="nofollow" target="_blank">Image Source</a></p>';
}

add_action('thesis_hook_after_post','image_source');

Note: After the first time you add the image_source custom field to a post, you’ll then be able to simply choose it from the drop down selector under “Add new custom field”, rather than having to choose “Enter new” again.