WordPress.org

Forums

Using image title & description (10 posts)

  1. transmothra
    Member
    Posted 4 years ago #

    I'm going crazy trying to find relevant info on this subject:

    I want to use the image title and description in posts. I don't want to simply iterate through images and display them as a gallery; i want to use the image where it was placed in the body of the post. How do i create a loop that uses the image title and description, and still keeps the images where they were inserted within the post content?

    Thanks tremendously for any suggestions....

  2. esmi
    Forum Moderator
    Posted 4 years ago #

  3. transmothra
    Member
    Posted 4 years ago #

    I got the feeling that that displays all the attachments at once. It doesn't? They're just inserted in the post content as normal?

    You'll have to pardon me, i've gotten awfully rusty with PHP over the last few years. Stupid WordPress and its plugins do everything for me and i practically never have to code anything anymore :P

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Either of those two methods will grab all the attachments but they don't actually display anything. Your additional code defines what to display and how.

  5. transmothra
    Member
    Posted 4 years ago #

    Oh, see that's what i mean. How do i present a post with pictures as it would normally be, except with the extra image information? In other words, how do i put the images where they are supposed to be in the context of the post?

    _title_
    |     | lorem ipsum blah blah blah
    |     | a bunch of text
    ------- quite a long story here
    descrip
    
    This is another paragraph _title_
    with more words in it    |       |
    about stuff and things   |       |
    like a normal post w/    ---------
    images embedded.          descrip
  6. esmi
    Forum Moderator
    Posted 4 years ago #

    If you just use <?php the_content();?>, the images will display as they were placed within the post or page.

  7. transmothra
    Member
    Posted 4 years ago #

    Yes, but see the example above. Instead of caption, i want to use the description, and i want to use the image name or title as an actual title above the image, like so:

    Dog Humping a Tuba    Lorem ipsum dolor sit amet.
    ------------------    Velit dictumst facilisis risus phasellus porta.
    |                |    Vel. Placerat et parturient etiam.
    |                |    Sit dapibus, egestas penatibus, aliquam.
    |                |    Sed, tortor magna, cursus. Integer.
    |                |    Urna. Parturient ut et sociis.
    |                |    Sagittis eu eu nec montes.
    |                |    Adipiscing nec placerat placerat porttitor.
    ------------------    Vel? Nunc, phasellus adipiscing eu.
    This one time at      Enim in parturient mid augue.
    band camp....         Sed, montes aliquet ridiculus diam.
                          Placerat? Augue, ac proin. Nec.
    Porta, magna cum, placerat montes cras elementum natoque egestas.
    Sagittis diam augue ac odio dolor, et proin.
    Nunc ridiculus egestas aliquet vel, tristique amet lacus.
    Pellentesque porta duis in! Magna, ac integer! Montes.
    Ut est nisi facilisis habitasse arcu vel! Amet.

    Or, alternately, to display a gallery of images which include an image name and description, rather than no name and a caption.

    The reason for this is that i'd like to reserve the caption as a shorter description of the image, and have a different page template using a longer description instead, and i'd like to pull the image name or title to use above the image to name it.

    Does that make more sense?

  8. transmothra
    Member
    Posted 4 years ago #

    Am i not explaining this clearly enough...? If so, sorry. It seems clear to me but maybe it's not.

  9. transmothra
    Member
    Posted 4 years ago #

    Does anybody understand what i'm asking here?

  10. transmothra
    Member
    Posted 4 years ago #

    Anybody know what i'm talking about? Does any of this make any sense?

Topic Closed

This topic has been closed to new replies.

About this Topic