Including links in image captions
-
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: (visible only to logged in users)
-
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 wordpress.com blog as yet > https://en.forums.wordpress.com/topic/new-gallery-features-exif-data?replies=49
-
-
-
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> -
-
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; } -
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.
-
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 { WHATEVER } -
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.
- The topic ‘Including links in image captions’ is closed to new replies.