WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Multiple Post Thumbnails] Get the caption of the secondary thumbnail

[Resolved] [Plugin: Multiple Post Thumbnails] Get the caption of the secondary thumbnail

Viewing 2 replies - 1 through 2 (of 2 total)
  • Patrick Whitty-Clarke
    Participant

    @zerodegreeburn

    I’d also like to know how to do this, It’s a vital feature for me. I can’t find any reference to it in the readme or plugin page.

    Patrick Whitty-Clarke
    Participant

    @zerodegreeburn

    OK I found a way of doing this here:

    <?
    $second_thumbnail_id = get_post_meta(get_the_ID(), "work_second-image_thumbnail_id", false);
    $second_id = $second_thumbnail_id[0];
    
    // The thumbnail caption:
    echo get_post($second_id)->post_excerpt;
    ?>

    I just had to change Change “page_second-image_thumbnail_id” to “work_second-image_thumbnail_id” which is the name of my post_type.

    I hope this helps people out.

    On another note it would be great if there was a way of making WordPress convert line breaks entered into the caption into
    tags, instead of manually adding
    tags at the end of each line in the caption. I guess that’s another topic though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] [Plugin: Multiple Post Thumbnails] Get the caption of the secondary thumbnail’ is closed to new replies.