WordPress.org

Ready to get started?Download WordPress

Forums

how get attachment description? (3 posts)

  1. zaasrvr
    Member
    Posted 6 years ago #

    Hello,
    How i can display the attachment description of a uploaded image?

  2. sunburntkamel
    Member
    Posted 6 years ago #

    AFAIK, it only displays when you call the_content() on the attachment page.

  3. Aesqe
    Member
    Posted 6 years ago #

    Basically, every attachment is also a post.

    So, something like

    $attachment->post_content

    should output the attachment description.

    ($attachment being attachment data you pulled out of the database).

    If you need further explanation please take a look here: http://codex.wordpress.org/Template_Tags/get_posts#Show_attachments_for_the_current_post

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags