Need help? Check out our Support site, then

Including links in image captions

  1. I could swear I saw an announcement saying we could now use code in our image captions. I wanted to put a link in the caption in an image widget. However, the code gets stripped when I save the widget.

    I'd like to to put images in my Home Page Feature Widget Area (top of the right sidebars in Morning After theme) with a link to a related post in the caption. I know I can link the image itself to another location, but I want an obvious link in the caption.

    Are links in captions possible? Are they possible within an image widget?

    The blog I need help with is

  2. See what Staff ie: iammattthomas has been saying in this thread ie. the carousel feature, images features, gallery, etc. are being upgraded and there has been no announcement in the offical blog as yet >

  3. You can do whatever you please if you use a Text widget.

  4. ~~justpi
    lol :D What took you so long?

  5. @justpi I'll have to try that. I used an image widget because I have trouble getting images in text widgets to center (I've made some CSS changes to make all widgets align left).

    Thanks, folks.

  6. Try this:
    <div class="wp-caption alignnone" style="width:470px;"><img style="width:460px;" src="IMAGE URL HERE" alt="DESCRIPTION HERE" /><p style="text-align:center;margin:2px 5px;">CAPTION <a href="URL HERE">INCLUDING LINK</a> HERE</p></div>

  7. Cool! Thx, justpi. That worked, and now I have a model for future efforts. :)

  8. You're welcome, but my suggestion is based on the default styling of the theme: in your case the white frame is not ok because of the changes you've made. Try adding this to your CSS:

    .wp-caption {
        text-align: center;
  9. justpi, before I saw your comment, I deleted the widget's gray background (which I'd specified in the CSS) and that more or less solved the problem visually. It's not exact, but not bad.

    The default style for The Morning After is centered captions, but I deliberately changed the CSS some time ago to make them all align left. However, I tend to like the contents (not the head) of the featured widget to be centered above the two sidebars below. It depends on what I put in it.

  10. Well, now you have completely eliminated the caption frame so you don't need the caption coding at all; you can set the #feature padding to 0, and use just this:
    <img style="width:470px;" src="IMAGE URL HERE" alt="DESCRIPTION HERE" /><p>CAPTION <a href="URL HERE">INCLUDING LINK</a> HERE</p>

    The styling of the caption paragraph can be taken care of in the CSS editor:

    #feature p {
  11. Got it. Had to reduce the img style to 450px before the image looked centered, but it looks great now. Thx for all you do for everyone.

Topic Closed

This topic has been closed to new replies.

About this Topic