<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blogWIP</title>
	<atom:link href="https://blogwip.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogwip.com</link>
	<description>the art of inbound marketing</description>
	<lastBuildDate>Mon, 04 Jan 2010 01:41:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Adding Linked Captions to Images in WordPress</title>
		<link>https://blogwip.com/images/adding-linked-captions-images-wordpress/</link>
					<comments>https://blogwip.com/images/adding-linked-captions-images-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Jeff Lambert]]></dc:creator>
		<pubDate>Sun, 03 Jan 2010 04:00:31 +0000</pubDate>
				<category><![CDATA[Images]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[post]]></category>
		<guid isPermaLink="false">http://blogwip.com/?p=261</guid>

					<description><![CDATA[Have you figured out how to include a linked copyright notice or photo credit in the caption of an image?  Have you tried to find a plugin to help with this?  Had any luck?  If so, let me know.  If not, don't worry, you're not alone.  So, what can a non-developer do?  This post covers one solution that isn't the most elegant but it gets the job done.]]></description>
										<content:encoded><![CDATA[<p>So, you are writing a Post in WordPress and are including an image that isn&#8217;t yours and doing so requires that you include the proper credits and, possibly, a link.  Or maybe it is yours and you want to include your photo credit / copyright .  Well this can be difficult within WordPress if you are using the standard image manager and trying to add a link within the caption.  This is because<span id="more-261"></span> WordPress strips out any HTML code within the caption.  Why are they doing this?  My guess is because the &#8220;Caption&#8221; also is being used as the value for the image&#8217;s &#8220;alt&#8221; text and, as such, cannot include other HTML element tags.  It would be nice if WordPress only stripped out the HTML code from the &#8220;alt&#8221; attribute and left it for the caption below the image but&#8230;.</p>
<p>Have you figured out how to include a linked caption?  Have you tried to find a plugin to help with this?  Had any luck?  If so, let me know.  If not, don&#8217;t worry, you&#8217;re not alone.  So, what can a non-developer do?  This post covers one solution that isn&#8217;t the most elegant but it gets the job done.  In subsequent posts I&#8217;ll discuss other options and image sources.</p>
<p>The first step in the process is the one you are use to, use the &lt;Add an Image&gt; button like you always  do.  The only difference is that you&#8217;ll put in the copyright or other image credit text in the &#8220;Caption&#8221; field along with any caption text you want.  Here&#8217;s an image that I&#8217;ve inserted as centered and medium in size along with the full caption that I want.</p>
<div id="attachment_262" style="width: 310px" class="wp-caption aligncenter"><a href="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-262" class="size-medium wp-image-262  " title="Tower Bridge at Night" src="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg" alt="Tower Bridge at Night (photo copyrighted by Jeff Lambert)" width="300" height="225" srcset="https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg 300w, https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg 600w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-262" class="wp-caption-text">Tower Bridge at Night (photo copyrighted by Jeff Lambert)</p></div>
<p>What I want to do next is to make the photographer&#8217;s name, Jeff Lambert, a link to a web page that explains the copyright terms of the photograph.  What this will require is switching the post editor from Visual mode to HTML mode followed by the manual manipulation of the image&#8217;s HTML code.  Once I perform this action the photograph will no longer be formatted and positioned within the post editor, that is, it will go from looking like the above image to the one below:</p>
<div id="attachment_302" style="width: 510px" class="wp-caption aligncenter"><a href="http://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_editor_shift.png"><img decoding="async" aria-describedby="caption-attachment-302" class="size-full wp-image-302" title="Image Caption Editor Shift" src="http://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_editor_shift.png" alt="Image Caption Editor Shift" width="500" height="357" srcset="https://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_editor_shift.png 500w, https://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_editor_shift-300x214.png 300w" sizes="(max-width: 500px) 100vw, 500px" /></a><p id="caption-attachment-302" class="wp-caption-text">View of How the Image Appears in the Post Editor Before and After Adjusting</p></div>
<p style="text-align: center;">
<p>As such, you&#8217;ll want to fully complete your post, including the insertion of images positioned as you&#8217;d like them, before you update the photo&#8217;s HTML code to update the caption.  That way you can tell if things look okay from a positional, sizing perspective.</p>
<h2>Manipulating the  HTML</h2>
<p>The following shows what you will see within the HTML view of the post once you insert an image and how you need to adjust it to add a link to a portion of the text:</p>
<p style="text-align: center;"><a href="http://blogwip.com/wpb/wp-content/uploads/2010/01/image_captioning_changes.png"><img decoding="async" class="size-full wp-image-298 aligncenter" title="Image Captioning Changes" src="http://blogwip.com/wpb/wp-content/uploads/2010/01/image_captioning_changes.png" alt="Image Captioning Changes" width="512" height="366" srcset="https://blogwip.com/wpb/wp-content/uploads/2010/01/image_captioning_changes.png 512w, https://blogwip.com/wpb/wp-content/uploads/2010/01/image_captioning_changes-300x214.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></a></p>
<p>Essentially, what you are doing is what the WordPress code behind the scenes is doing when it processes an image within the post&#8217;s text that is encapsulated by  tags.  To prove this, do a preview of the post and then look for the image within the pages Source.  You should find something quite similar if not the same as what we are changing the code to within the HTML editor.  One item of note is that you&#8217;ll change the width reference in the outer &lt;div&gt; element to add 10 to it.  So, in the example here, I changed 300 to 310.</p>
<p>To further clean this caption up, I pushed the copyright line down to a second line and also made it slightly smaller than the caption text by adding the following HTML between the first line and second line of text:</p>
<p><a href="http://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_line_break.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-299" title="Image Caption Line Break" src="http://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_line_break.png" alt="Image Caption Line Break" width="478" height="72" srcset="https://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_line_break.png 478w, https://blogwip.com/wpb/wp-content/uploads/2010/01/image_caption_line_break-300x45.png 300w" sizes="auto, (max-width: 478px) 100vw, 478px" /></a></p>
<p>The resulting image will look as follows:</p>
<div id="attachment_262" class="wp-caption aligncenter" style="width: 310px;"><a href="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg"><img loading="lazy" decoding="async" class="size-medium wp-image-262" title="Tower Bridge at Night" src="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg" alt="Tower Bridge at Night (photo copyrighted by Jeff Lambert)" width="300" height="225" srcset="https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg 300w, https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg 600w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p class="wp-caption-text">Tower Bridge at Night</p>
<p style="text-align:center;font-size:.8em;padding-top:0;padding-bottom:0">(photo copyrighted by <a href="http://jefflambert.com/copyright-all-rights-reserved/" target="_blank">Jeff Lambert</a>)</p>
</div>
<p>Of course, my example shows how to center align an image with a linked caption.  What happens if you want to position it to the right or left?  Well, it&#8217;s pretty simple.  Just change any position word to the desired position.</p>
<div id="attachment_262" class="wp-caption alignleft" style="width: 220px;"><a href="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg"><img loading="lazy" decoding="async" class="size-medium wp-image-262" title="Tower Bridge at Night" src="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg" alt="Tower Bridge at Night (photo copyrighted by Jeff Lambert)" width="210" height="158" srcset="https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg 300w, https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg 600w" sizes="auto, (max-width: 210px) 100vw, 210px" /></a></p>
<p class="wp-caption-text">Tower Bridge at Night</p>
<p style="text-align:center;font-size:.8em;padding-top:0;padding-bottom:0">(photo copyrighted by <a href="http://jefflambert.com/copyright-all-rights-reserved/" target="_blank">Jeff Lambert</a>)</p>
</div>
<p>This image is on the left.  I also scaled it down 70%.  This meant that I needed to do two things after inserting the image and adjusting it as I did above.  First, I used the image edit button (hover over the image and click the picture button) to select the 70% size from the image size scale.  This updated the size of the image in the HTML view.  I checked to see what this changed to, added 10 and then updated the outer &lt;div&gt; width to this new value, in this case, 220px.  The outer &lt;div&gt; class also reads class=<em>&#8220;wp-caption alignleft&#8221; </em>instead of <em>class=&#8221;wp-caption aligncenter&#8221;</em>.</p>
<div id="attachment_262" class="wp-caption alignright" style="width: 220px;"><a href="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg"><img loading="lazy" decoding="async" class="size-medium wp-image-262" title="Tower Bridge at Night" src="http://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg" alt="Tower Bridge at Night (photo copyrighted by Jeff Lambert)" width="210" height="158" srcset="https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02-300x225.jpg 300w, https://blogwip.com/wpb/wp-content/uploads/2009/12/Tower_Bridge_02.jpg 600w" sizes="auto, (max-width: 210px) 100vw, 210px" /></a></p>
<p class="wp-caption-text">Tower Bridge at Night</p>
<p style="text-align:center;font-size:.8em;padding-top:0;padding-bottom:0">(photo copyrighted by <a href="http://jefflambert.com/copyright-all-rights-reserved/" target="_blank">Jeff Lambert</a>)</p>
</div>
<p>To position the image on the right it was as simple as changing the class to <em>class=&#8221;wp-caption alignright&#8221;</em>.</p>
<p>The one thing I did find when putting an image at the end like this is that the author box would slip under the image, so, I simply added some extra lines to the end of the text to push things down.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogwip.com/images/adding-linked-captions-images-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
