Use image descriptions as automatic captions in WP 2.5 (2 posts)

  1. miamihurricane
    Posted 7 years ago #

    I am currently building a replacement site for our student newspaper. We're using a Premium News Theme, which has worked out great for us, but we also need automatic image captions.

    I've already found a caption plugin that pulls the data from the caption field in the media uploader dialog, however I recently discovered that WordPress 2.5 will auto embed EXIF data and insert it in the description field, rather than the caption field.

    Does anyone know how to program the posts to place this info as a caption instead of using either the title field or caption (alt) field? I figured I can probably modify the caption plugin to pull the text from there, but I don't know how to code it in PHP. As far as I can tell it involves some $attachment->post_content; or something similar. It looks like this person was on the right track, but I need it embedded within the post itself: http://wordpress.org/support/topic/171988?replies=4.

    I'll be happy to provide more information if I didn't make it clear enough.

    We're very exciting about using WordPress, and thanks for the help!

  2. datapharmer
    Posted 6 years ago #

    Hi, If you haven't figured it out yet here is what to do:
    open /wp-admin/includes/media.php
    'post_excerpt' => array(
    'label' => __('Caption'),
    'value' => $edit_post->post_excerpt,

    'post_excerpt' => array(
    'label' => __('Caption'),
    'value' => $edit_post->post_content,

    The change is on line 948 in wordpress 2.7, not sure about 2.5, but it should be near there.

    If you get some time I'd love to pick your brain about wordpress any how it has been working for your school.

Topic Closed

This topic has been closed to new replies.

About this Topic