<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SevenSpark</title>
	
	<link>http://sevenspark.com</link>
	<description>Web Design Studio</description>
	<lastBuildDate>Tue, 22 May 2012 17:21:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sevenspark" /><feedburner:info uri="sevenspark" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>How to add links to WordPress image captions</title>
		<link>http://sevenspark.com/tutorials/how-to-add-links-to-wordpress-image-captions?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-add-links-to-wordpress-image-captions</link>
		<comments>http://sevenspark.com/tutorials/how-to-add-links-to-wordpress-image-captions#comments</comments>
		<pubDate>Tue, 24 Apr 2012 22:35:37 +0000</pubDate>
		<dc:creator>sevenspark</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[captions]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[shortcodes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sevenspark.com/?p=448</guid>
		<description><![CDATA[<p>One issue I've run into in WordPress is that you can't add HTML tags, specifically anchors, into your image captions.  This tutorial will show you how to insert links into your image captions so you can link back for photo credits, etc.</p><p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></description>
			<content:encoded><![CDATA[<p>The WordPress media manager allows you to add captions to your images, which can be inserted into your post content wrapped in the <strong>caption</strong> shortcode.</p>
<p><a target="_blank" href="http://i.imgur.com/EZrWU.png"><img src="http://i.imgur.com/EZrWU.png" style="max-width:100%;" /></a></p>
<p>You can see that I&#8217;ve placed anchor tags in the photo caption to link to the photo credit:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Photo credit: <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.flickr.com/photos/nattu/2735064420&quot;</span>&gt;</span>nattu<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></div></td></tr></tbody></table></div>
<p></code></p>
<p>When you click the "Insert into Post" button, you end up with this markup in your editor:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[caption id=&quot;attachment_1133&quot; align=&quot;alignleft&quot; width=&quot;300&quot; <br />
caption=&quot;Photo credit: &amp;lt;a href=&amp;quot;http://www.flickr.com/photos/nattu/2735064420&amp;quot;&amp;gt;nattu&amp;lt;/a&amp;gt;&quot;]<br />
&lt;a data-rel=&quot;prettyPhoto&quot; title=&quot;The Entrance&quot; href=&quot;http://localhost/agility/wp-content/uploads/2012/03/TheEntrance.jpg&quot;&gt;<br />
&lt;img src=&quot;http://localhost/agility/wp-content/uploads/2012/03/TheEntrance-300x199.jpg&quot; alt=&quot;&quot; title=&quot;The Entrance&quot; width=&quot;300&quot; height=&quot;199&quot; class=&quot;scale-with-grid size-medium wp-image-1133&quot; /&gt;&lt;/a&gt;[/caption]</div></td></tr></tbody></table></div>
<p><a href="#code-solution">Skip to the code solution</a></p>
<h3>The Problem</h3>
<p>The issue is that all the HTML entities in the caption attribute (specifically, the anchor tags) are encoded.  That is, instead of</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Photo credit: &lt;a href=&quot;http://www.flickr.com/photos/nattu/2735064420&quot;&gt;nattu&lt;/a&gt;</div></td></tr></tbody></table></div>
<p>we have</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Photo credit: &amp;lt;a href=&amp;quot;http://www.flickr.com/photos/nattu/2735064420&amp;quot;&amp;gt;nattu&amp;lt;/a&amp;gt;</div></td></tr></tbody></table></div>
<p>As a result, instead of getting the desired output in our caption:</p>
<pre>
Photo credit: <a href="http://www.flickr.com/photos/nattu/2735064420">nattu</a>
</pre>
<p>We get the encoded HTML markup instead:</p>
<pre>
Photo credit: &lt;a href=&quot;http://www.flickr.com/photos/nattu/2735064420&quot;&gt;nattu&lt;/a&gt;
</pre>
<h3>The Solution</h3>
<p>Now, the HTML entities have to be escaped in order to safely place them in the caption="" attribute of the caption shortcode (or at least the double quotes do), and in any event it's very inconvenient to decode the entities manually.  What we'll need to do is decode them programmatically when the shortcode is processed at run time.</p>
<p>Helpfully, WordPress's <strong>img_caption_shortcode</strong> function (wp-includes/media.php) includes a filter that allows us to hook in and override the caption.  Here's the original function:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009933; font-style: italic;">/**<br />
&nbsp;* The Caption shortcode.<br />
&nbsp;*<br />
&nbsp;* Allows a plugin to replace the content that would otherwise be returned. The<br />
&nbsp;* filter is 'img_caption_shortcode' and passes an empty string, the attr<br />
&nbsp;* parameter and the content parameter values.<br />
&nbsp;*<br />
&nbsp;* The supported attributes for the shortcode are 'id', 'align', 'width', and<br />
&nbsp;* 'caption'.<br />
&nbsp;*<br />
&nbsp;* @since 2.6.0<br />
&nbsp;*<br />
&nbsp;* @param array $attr Attributes attributed to the shortcode.<br />
&nbsp;* @param string $content Optional. Shortcode content.<br />
&nbsp;* @return string<br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">function</span> img_caption_shortcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$attr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Allow plugins/themes to override the default caption template.</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'img_caption_shortcode'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$output</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span>shortcode_atts<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'id'</span>&nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'align'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignnone'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'width'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'caption'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">||</span> <a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$caption</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$id</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'id=&quot;'</span> <span style="color: #339933;">.</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;div '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'class=&quot;wp-caption '</span> <span style="color: #339933;">.</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$align</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; style=&quot;width: '</span> <span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$width</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'px&quot;&gt;'</span><br />
&nbsp; &nbsp; <span style="color: #339933;">.</span> do_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$content</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;p class=&quot;wp-caption-text&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$caption</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/p&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gallery'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'gallery_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>We're just going to hook in and use the same code, but add a line of our own to decode the HTML tags.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$caption</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/html_entity_decode"><span style="color: #990000;">html_entity_decode</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$caption</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h3 id="code-solution">The Code</h3>
<p>So, our final function, which I've placed in <strong>functions.php</strong>, looks like this:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//Our custom caption shortcode function is based on the WordPress Core version with a small change</span><br />
<span style="color: #000000; font-weight: bold;">function</span> custom_img_caption_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$a</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <a href="http://www.php.net/extract"><span style="color: #990000;">extract</span></a><span style="color: #009900;">&#40;</span>shortcode_atts<span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'id'</span>&nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'align'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignnone'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'width'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'caption'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$attr</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">||</span> <a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$caption</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$caption</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/html_entity_decode"><span style="color: #990000;">html_entity_decode</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$caption</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp;<span style="color: #666666; font-style: italic;">//Here's our new line to decode the html tags</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$id</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'id=&quot;'</span> <span style="color: #339933;">.</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; '</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;div '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'class=&quot;wp-caption '</span> <span style="color: #339933;">.</span> esc_attr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$align</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; style=&quot;width: '</span> <span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$width</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'px&quot;&gt;'</span><br />
&nbsp; &nbsp; <span style="color: #339933;">.</span> do_shortcode<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$content</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;p class=&quot;wp-caption-text&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$caption</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/p&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">//Add the filter to override the standard shortcode</span><br />
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'img_caption_shortcode'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_img_caption_shortcode'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>And that's it!  Just pop that code into your functions.php and you should be able to add links to your photo captions.  If anyone knows a better way of doing this, let me know in the comments.  Enjoy!</p>
<p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></content:encoded>
			<wfw:commentRss>http://sevenspark.com/tutorials/how-to-add-links-to-wordpress-image-captions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Add a Custom Class to a WordPress Menu Item</title>
		<link>http://sevenspark.com/tutorials/how-to-add-a-custom-class-to-a-wordpress-menu-item?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-add-a-custom-class-to-a-wordpress-menu-item</link>
		<comments>http://sevenspark.com/tutorials/how-to-add-a-custom-class-to-a-wordpress-menu-item#comments</comments>
		<pubDate>Fri, 20 Apr 2012 12:27:06 +0000</pubDate>
		<dc:creator>sevenspark</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sevenspark.com/?p=439</guid>
		<description><![CDATA[<p>This is a question I get a lot related to UberMenu &#8211; WordPress Mega Menu Plugin, though it&#8217;s actually baked into WordPress Core. It&#8217;s a very powerful feature, as it allows you to target either a single menu item or a group of menu items with a single class. However, the option is hidden from [...]</p><p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></description>
			<content:encoded><![CDATA[<p>This is a question I get a lot related to <a href="http://bit.ly/UberMenu">UberMenu &#8211; WordPress Mega Menu Plugin</a>, though it&#8217;s actually baked into WordPress Core.  It&#8217;s a very powerful feature, as it allows you to target either a single menu item or a group of menu items with a single class.  However, the option is hidden from the UI by default.  In order to add a class to a menu item, you first have to reveal it.</p>
<h4>1. In Appearance > Menus, click the <em>Screen Options</em> tab</h4>
<p><img src="http://i.imgur.com/HjhgL.png" alt="Click the Screen Options tab" /></p>
<h4>2. Under <em>Show advanced menu properties</em>, check <strong>CSS Classes</strong></h4>
<p><img src="http://i.imgur.com/x19jQ.png" alt="Check CSS Classes option" /></p>
<h4>3. Now expand any menu item to reveal the <em>CSS Classes (optional)</em> text input.</h4>
<p><img src="http://i.imgur.com/Xe2if.png" alt="CSS Classes text input" /></p>
<h4>4. Enter your class name and save your menu to apply the class to the menu item</h4>
<p>The class will be added to the LI (list item) element, the same element that has the menu item ID attached.  You can then style your item like this, where .menu is replaced by the class used for your menu:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/* Target the menu item LI */</span><br />
<span style="color: #6666ff;">.menu</span> li.myClass<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #808080; font-style: italic;">/* Margin might go here */</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #808080; font-style: italic;">/* Target the menu item Anchor (link) */</span><br />
<span style="color: #6666ff;">.menu</span> li<span style="color: #6666ff;">.myClass</span> <span style="color: #00AA00;">&gt;</span> a<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #808080; font-style: italic;">/* Colors, font sizes, would normally go here */</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/* Target the menu item LI in UberMenu */</span><br />
<span style="color: #cc00cc;">#megaMenu</span> ul<span style="color: #6666ff;">.megaMenu</span> li.myClass<span style="color: #00AA00;">&#123;</span><br />
<br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #808080; font-style: italic;">/* Target the menu item Anchor (link) in UberMenu */</span><br />
<span style="color: #cc00cc;">#megaMenu</span> ul<span style="color: #6666ff;">.megaMenu</span> li<span style="color: #6666ff;">.myClass</span> <span style="color: #00AA00;">&gt;</span> a<span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #808080; font-style: italic;">/* Colors, font sizes, would go here */</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>Remember that you may need to increase your selector specificity or use the !important flag in order to ensure that your new styles are applied.</p>
<h4>5. Enjoy even more customization control over your menu!</h4>
<p>Note that this is a standard WordPress feature and works with or without UberMenu.</p>
<p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></content:encoded>
			<wfw:commentRss>http://sevenspark.com/tutorials/how-to-add-a-custom-class-to-a-wordpress-menu-item/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>State of the Agility</title>
		<link>http://sevenspark.com/announcements/state-of-the-agility?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=state-of-the-agility</link>
		<comments>http://sevenspark.com/announcements/state-of-the-agility#comments</comments>
		<pubDate>Fri, 30 Mar 2012 04:07:12 +0000</pubDate>
		<dc:creator>sevenspark</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://sevenspark.com/?p=436</guid>
		<description><![CDATA[<p>UPDATE: May 11Agility is now available! UPDATE: May 1Agility is now in beta testing! Over the past few months I&#8217;ve received a steady stream of requests for status updates on the development of the WordPress version of my Agility template. In an effort to address these inquiries more efficiently (and thereby free up more time [...]</p><p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></description>
			<content:encoded><![CDATA[<div class="alert"><strong>UPDATE: May 11</strong><br/><br/><a href="http://sevenspark.com/out/agility-wp">Agility is now available!</a></div>
<p><br/></p>
<div class="alert"><strong>UPDATE: May 1</strong><br/><br/>Agility is now in beta testing!</div>
<p>Over the past few months I&#8217;ve received a steady stream of requests for status updates on the development of the WordPress version of my <a href="http://labs.sevenspark.com/Agility-HTML">Agility template</a>.  In an effort to address these inquiries more efficiently (and thereby free up more time to work on the theme!), I&#8217;ve decided to write this quick post.</p>
<p>First off, let me say how much I appreciate everyone&#8217;s interest and enthusiasm &#8211; it really means a lot!  I&#8217;m very exited about it myself.  Unfortunately, a series of events outside my control have delayed its release somewhat.  I&#8217;m very disappointed that it hasn&#8217;t been possible to release Agility sooner, especially because I know there are people waiting for its completion, and for that I apologize.  At the same time, I am developing the theme as quickly as I possibly can &#8211; however, I won&#8217;t sacrifice the quality of the product for an earlier release date; that won&#8217;t help anyone.</p>
<p>Let me assure you that completing Agility is my top priority, and I will be releasing it as soon as I possibly can.  Whenever I have an update, I will post it to Twitter and Facebook, so be sure to check there for any announcements.</p>
<p>I&#8217;d respectfully request that those who are interested in the theme restrain themselves from requesting release date information directly; I promise, I will have it out as quickly as possible (trust me, I want it to be released more than anyone!).  But responding to serveral individual requests for information each day isn&#8217;t helping speed things along, as I&#8217;m sure you understand :)</p>
<p>Thank you so much for your patience!  I&#8217;m really pleased with how Agility for WordPress is coming out, and I hope you will be too!</p>
<p>All the best,</p>
<p>Chris</p>
<p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></content:encoded>
			<wfw:commentRss>http://sevenspark.com/announcements/state-of-the-agility/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What’s new in UberMenu 2.0? (A Responsive, More Flexible WordPress Mega Menu)</title>
		<link>http://sevenspark.com/wordpress-plugins/responsive-wordpress-mega-menu?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=responsive-wordpress-mega-menu</link>
		<comments>http://sevenspark.com/wordpress-plugins/responsive-wordpress-mega-menu#comments</comments>
		<pubDate>Fri, 10 Feb 2012 14:30:51 +0000</pubDate>
		<dc:creator>sevenspark</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[improved]]></category>
		<category><![CDATA[mega menu]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[responsive]]></category>
		<category><![CDATA[ubermenu]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://sevenspark.com/?p=406</guid>
		<description><![CDATA[<p>UberMenu 2.0 - WordPress Mega Menu Plugin brings some awesome new features to the table, including responsive menus, enhanced CSS, refreshed skins, and easily defined submenu columns.</p><p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></description>
			<content:encoded><![CDATA[<h3>UberMenu 2.0 &#8211; WordPress Mega Menu Plugin brings some awesome new features to the table, including responsive menus, enhanced CSS, refreshed skins, and easily defined submenu columns.</h3>
<p>It&#8217;s been a year since I first released <a href="http://wpmegamenu.com">UberMenu &#8211; WordPress Mega Menu Plugin</a>.  In that time it has sold almost 4,000 copies and continues to be an extremely popular WordPress menu solution.  I&#8217;m so lucky that this plugin has had such success &#8211; it has allowed me to move my business to digital goods development full-time, which has been wonderful.  I&#8217;d like to thank all of the great customers who have bought UberMenu, I truly appreciate it.</p>
<div class="alert alert-warning">Are you upgrading from an old version of UberMenu to version 2.0?  Please read the <a href="#">Important Upgrade Instructions</a></div>
<p>In the last year I&#8217;ve gathered a lot of insight into the menu process through my interactions with the many users I&#8217;ve supported.  I&#8217;ve learned a lot about what features users make the most use of, what tends to cause confusion, common customization needs, and a whole lot more.  </p>
<p>I&#8217;ve spent the last month and a half distilling this accumulated knowledge into what is now UberMenu 2.0, refining functionality and enhancing the feature set.  My goals with UberMenu 2.0 have been:</p>
<ol>
<li>Increase the intuitiveness of the plugin</li>
<li>Improve areas that tend to cause customer confusion</li>
<li>Increase javascript efficiency</li>
<li>Increase plugin extensibility</li>
<li>Improve menu design, robustness, and flexibility</li>
</ol>
<p>I&#8217;m very proud of the new UberMenu 2.0, which represents a huge time investment to deliver major enhancements.  Here are some of the new features in UberMenu 2.0.</p>
<h3>Enhanced CSS</h3>
<p>The basic CSS structure of UberMenu has been torn down and rebuilt to provide an even stronger foundation for the menu.  This means menus act more intuitively out of the box, and customizations are simpler to implement.  It also means that UberMenu works excellently as a pure CSS menu with full-width submenus.  </p>
<h3>More Efficient Javascript</h3>
<p>A stronger CSS foundation means less calculations in the javascript, which leaves us with a much lighter weight and more efficient jQuery plugin enhancing UberMenu.  The javascript has also been rewritten as a jQuery plugin, implementing jQuery best practices.  The upshot is that UberMenu now loads and runs faster than ever.</p>
<h3>Full Width Submenus and Defined Columns</h3>
<p>One part of UberMenu 1.x which was less intuitive than it could be was column formatting.  Columns were sized entirely based on their content size, which led to some interesting corner cases. While these issues were easily resolvable via custom CSS, for users without a working knowledge of the box model, such strange behavior was frustrating and confusing.</p>
<p>In UberMenu 2.0, columns can be sized in two ways, on a per-submenu basis: naturally, or in grid based columns.  In a natural layout, each column is sized to its contents, and each column may be a different width.  This is great for single-row submenus.  For multiple-row submenus, UberMenu 2.0 adds the ability to set a submenu to be full-width, and apply a specific number of columns to the submenu.  These columns will be uniformly sized, and extend the entire width of the submenu automatically.</p>
<p>I believe this new system is much more intuitive and will provide users a much better experience when wrangling their submenus into the formats they desire.</p>
<p><img src="http://i.imgur.com/ydvZs.png" alt="Grid Columns" title="Grid Columns" style="width:100%;" /></p>
<h3>Fully Responsive Menus</h3>
<p>When designing <a href="http://labs.sevenspark.com/Agility-HTML">Agility HTML5 Template</a>, I spent a long while studying responsive design best practices.  UberMenu makes use of that knowledge to deliver a responsive mega menu.  As the viewport changes, UberMenu&#8217;s contents size intelligently to optimize display at each size.  (Note this can be disabled for non-responsive themes).</p>
<p><img src="http://i.imgur.com/SMsKO.png" alt="Responsive - Mobile Landscape" title="Responsive - Mobile Landscape" style="width:48%; float:left;" /><img src="http://i.imgur.com/1rwFR.png" alt="Responsive - Mobile Portrait" title="Responsive - Mobile Portrait" style="width:48%; float:right;" /></p>
<div style="clear:both;"></div>
<h3>iPhone and iPad Compatibility</h3>
<p>Going hand in hand with the responsive mega menu enhancements, UberMenu is now even more compatible with iOS devices, delivering an intuitive user experience for responsive themes.</p>
<h3>More Flexibility</h3>
<p>Another goal of UberMenu 2.0 is to build in some of the most common customizations into the Control Panel, to avoid core UberMenu edits.  Now you can:</p>
<ol>
<li>Customize dropdown animation speeds</li>
<li>Trigger via hover in addition to hoverIntent and click</li>
<li>Customize hover intent timing</li>
<li>Disable image resizing</li>
<li>Enable or disable loading UberMenu on registration and login pages</li>
</li>
</ol>
<p><img src="http://i.imgur.com/SYplp.png" style="max-width:100%" /></p>
<h3>Fresh menu skins</h3>
<p>Both design trends and my own design skills have advanced a lot in the last year.  UberMenu 2.0 features refreshed menu skins, with progressive CSS3 enhancements.  The designs are now cleaner and more modern (the old designs are still included for legacy use, if desired).</p>
<p><strong>Watch for more menu skin options coming soon!</strong></p>
<h3>Rewritten Style Generator</h3>
<p>The UberMenu Style Generator has been completely rewritten to make use of LESS via <a href="http://leafo.net/lessphp/">lessphp</a>.  This means more consistency and easier upgrades.  The new Style Generator also has the ability to write your custom style to an external stylesheet rather than including the CSS in the site header (though that is still an option).  </p>
<h3>A note on backwards compatibility</h3>
<p>In developing UberMenu 2.0, I&#8217;ve made every effort to maximize compatibility with previous UberMenu installations.  All menu items and their options, as well as UberMenu Control Panel options, will remain intact.  Unfortunately, some sacrifices had to be made in the name of progress.  Because the underlying CSS structure has been enhanced, some types of customizations may no longer appear as desired and may need to be reworked &#8211; though in some cases they will no longer be necessary at all!  Specifically, submenu positioning and column resizing may need to be readdressed.  However, all previous class names and IDs have remained consistent to minimize the impact and make the transition for users from 1.x to 2.0 as smooth as possible.</p>
<p><br/></p>
<hr/>
<br/></p>
<p>Well, that&#8217;s about it.  I hope UberMenu customers enjoy the upgrade!  It&#8217;s been a long process getting to this point, and I&#8217;m very pleased with the results.  Feedback is always welcome and will be considered for future releases whenever possible.</p>
<p>Thanks again to all UberMenu customers for your business!</p>
<p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></content:encoded>
			<wfw:commentRss>http://sevenspark.com/wordpress-plugins/responsive-wordpress-mega-menu/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>ReplyPantry – Text in a Can for the Envato Marketplaces</title>
		<link>http://sevenspark.com/free-stuff/replypantry-text-in-a-can-for-the-envato-marketplaces?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=replypantry-text-in-a-can-for-the-envato-marketplaces</link>
		<comments>http://sevenspark.com/free-stuff/replypantry-text-in-a-can-for-the-envato-marketplaces#comments</comments>
		<pubDate>Sun, 01 Jan 2012 16:34:21 +0000</pubDate>
		<dc:creator>sevenspark</dc:creator>
				<category><![CDATA[Free Stuff]]></category>
		<category><![CDATA[author tool]]></category>
		<category><![CDATA[Chrome Extension]]></category>
		<category><![CDATA[CodeCanyon]]></category>
		<category><![CDATA[Envato]]></category>
		<category><![CDATA[Envato Marketplaces]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[free stuff]]></category>
		<category><![CDATA[ThemeForest]]></category>
		<category><![CDATA[utility]]></category>

		<guid isPermaLink="false">http://sevenspark.com/?p=396</guid>
		<description><![CDATA[<p>ReplyPantry is a Google Chrome Extension that allows Envato Marketplace users to insert customized text snippets into forum posts or item comments.</p><p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></description>
			<content:encoded><![CDATA[<div class="ss-buttons">
<a href="https://github.com/sevenspark/ReplyPantry/raw/master/replypantry.crx" alt="Download ReplyPantry" title="Download ReplyPantry" class="ss-button ss-button-large">Download</a> <a href="https://github.com/sevenspark/ReplyPantry" class="ss-button ss-button-large" target="_blank">View on GitHub</a>
</div>
<p>ReplyPantry is a Google Chrome Extension that allows Envato Marketplace users to insert customized text snippets into forum posts or item comments.</p>
<p>Once you install ReplyPantry you&#8217;ll see the can icon below your reply boxes in the forums – and above in the item comments. Click the can icon to show the canned text snippets (“cans”), and click a can title to insert that canned text. You’re able to add, save, edit, and remove cans. Hopefully it’s fairly intuitive.</p>
<p>If you&#8217;re using Google Chrome, clicking the download link should allow you to download and prompt you to install the extension.</p>
<p><a href="http://sevenspark.com">SevenSpark - Web Design Studio</a></p>]]></content:encoded>
			<wfw:commentRss>http://sevenspark.com/free-stuff/replypantry-text-in-a-can-for-the-envato-marketplaces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

