• Hi. I need help getting an image caption to show up under my image. Since my images have both a title and a description, the description may as well serve as the caption.

    I’m using WordPress 1.5 — I’m too close to the deadline to upgrade to WP 2.1 right now.

    I’m placing images into my posts using the normal interface (click image, choose “send to editor”). That puts the image in my post just fine.

    I used Sketchbunny’s directions to edit wp-admin/inline-uploading.php to add a title attribute to my image tag. That worked, too.

    I tried to use those same directions to add a simple caption after the image tag, but it didn’t show up at all. Sketchbunny says that his edit only affects new images, so I added a brand new image to the article, but still no caption.

    Can anyone tell me what I might be doing wrong? Besides using WP 1.5, I mean.

    My code:


    imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" title=\"{$title}\" $height_width /><br>\"{$descr}\"';
    imgb[{$ID}] = '<img id=\"image{$ID}\" src=\"{$image['guid']}\" alt=\"{$title}\" title=\"{$title}\" $height_width /><br>\"{$descr}\"';

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter c-mplx

    (@c-mplx)

    An alternate or additional question might be:

    I need to modify the HTML output to render an attached image. How do I do that?

    For example, if you wanted all of your images to be output as


    <div style="float: right;"><img ... /></div>

    Instead of


    <img align="right" ... />

    Then how would you do that? Which file controls that?

    hey check out my javascript, i think it might solve your problem:

    https://www.evercloud.com/blog/make-caption-under-images-in-wordpress/web-development/20070405/

    Open them in Photoshop and add whatever you want where you want it?!

    Why not try the lightbox plugin?

    Thread Starter c-mplx

    (@c-mplx)

    FlashBuddy: because you should show your text as text, not as part of the image. For one thing, your reader gets to resize it if they choose. Also, it’s much faster if you need to edit the caption, which is often the case in a news environment.

    Kahil: Lightbox shows the image overtop the post; it won’t show a caption underneath an image within the same post. It’s cool, but unrelated. Or am I missing some hidden feature?

    The idea is to put a paragraph of caption underneath the image, and to have the caption come from the image’s meta info. You wouldn’t want to type the caption in a second time just because you used the image again somewhere else.

    Evercloud: Thanks, this looks good! I’ll have to try it out.

    The one thing I’d like is if you didn’t have to add the JavaScript to the image tag each time. We should be able to make all image tags come with that JavaScript automatically. That’s the sort of change that was escaping me, for some reason.

    I suggest you return to the DIVs. If the only floating elements you have are your images, you can style each one to float and clear:right or clear:all.

    Thanks!

    Try the Image Caption Easy plugin: https://imagecaptioneasy.contentspring.com/.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need an image caption below my images’ is closed to new replies.