<?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>Michael Kubler's Blog &#187; web design</title>
	<atom:link href="http://www.kublermdk.com/category/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kublermdk.com</link>
	<description>Photography, PHP, and everything else.</description>
	<lastBuildDate>Mon, 09 Jan 2012 14:57:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress &#8211; Properly captioned images</title>
		<link>http://www.kublermdk.com/2008/11/17/wordpress-properly-captioned-images/</link>
		<comments>http://www.kublermdk.com/2008/11/17/wordpress-properly-captioned-images/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 08:33:12 +0000</pubDate>
		<dc:creator>Michael Kubler</dc:creator>
				<category><![CDATA[web design]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.kublermdk.com/?p=341</guid>
		<description><![CDATA[A little while ago I noticed that wordpress 2.6 introduced the ability to add captions to images. This seemed like a great idea, and looked great in the actual WordPress Admin WYSIWYG editor (TinyMCE), however I couldn&#8217;t actually find any themes that had the proper CSS for the captioning, so decided I would make it [...]]]></description>
			<content:encoded><![CDATA[<p>A little while ago I noticed that wordpress 2.6 introduced the ability to add captions to images.<br />
This seemed like a great idea, and looked great in the actual WordPress Admin WYSIWYG editor (TinyMCE), however I couldn&#8217;t actually find any themes that had the proper CSS for the captioning, so decided I would make it up myself.</p>
<p><a href="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-sunset-captioning-example-witharrow.jpg"><img class="aligncenter size-full wp-image-343" title="wp-admin-sunset-captioning-example-witharrow" src="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-sunset-captioning-example-witharrow.jpg" alt="" width="500" height="517" /></a></p>
<p>In the editor it looked good :<br />
<img class="aligncenter size-full wp-image-342" style="border: none;" title="wp-admin-sunset-captioned" src="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-sunset-captioned.jpg" alt="" width="319" height="241" /></p>
<p>But on the actual page it just looked like there was a standard image, with just a bit of text below it, but not actually attached to it :</p>
<p><img class="alignnone size-full wp-image-345" style="border: none;" title="sunset-unstyled-captioning" src="http://www.kublermdk.com/wp-content/uploads/2008/11/sunset-unstyled-captioning.jpg" alt="" width="349" height="242" /></p>
<p>I hacked the CSS of my WordPress theme and the end result was pretty close :</p>
<div id="attachment_57" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.kublermdk.com/wp-content/uploads/2008/06/img_1036-sunset.jpg"><img class="size-medium wp-image-57" title="img_1036-sunset" src="http://www.kublermdk.com/wp-content/uploads/2008/06/img_1036-sunset-300x200.jpg" alt="A beautiful Sunset" width="300" height="200" /></a><p class="wp-caption-text">A beautiful Sunset</p></div>
<p>To make the changes, I went into the WordPress Admin page, then Design -&gt; Theme Editor.<br />
I&#8217;m using the great Andreas09 theme, and had to make two changes in two of the style sheets, as shown in the images below :</p>
<div id="attachment_354" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-design-bluecss.jpg"><img class="size-medium wp-image-354" title="wp-admin-design-bluecss" src="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-design-bluecss-300x215.jpg" alt="Added CSS is the selected text" width="300" height="215" /></a><p class="wp-caption-text">Added CSS is the selected text</p></div>
<div id="attachment_353" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-design-stylecss.jpg"><img class="size-medium wp-image-353" title="wp-admin-design-stylecss" src="http://www.kublermdk.com/wp-content/uploads/2008/11/wp-admin-design-stylecss-300x211.jpg" alt="Image border CSS (not mandatory)" width="300" height="211" /></a><p class="wp-caption-text">Image border CSS (not mandatory) - Click for full size</p></div>
<p>Below is the commented CSS styles to copy/paste into your theme (watch out for the Padding-left and padding-right values which might need to be edited according to your theme)  :</p>
<p class="code"><span style="color: #3366ff;"> /* This shows the actual grey box and border */</span><br />
<strong> .wp-caption</strong> {<br />
background-color : #e1e1e1;<br />
border: 1px solid #484848;<br />
<span style="color: #3366ff;"> /* I had to play with the padding right value, you might just need 5px, depending on the theme */ </span><br />
padding-right: 12px;<br />
margin-right: 2px;<br />
margin-left: 1px;<br />
margin-bottom: .3em;<br />
margin-top: .3em;<br />
}<br />
<span style="color: #3366ff;"> /* This sets the caption to be centred  below the image */</span><br />
<strong> .wp-caption-text</strong> {<br />
text-align: center;<br />
}<br />
<span style="color: #3366ff;"> /* This allows the centre aligned images to actually be in the centre */</span><br />
<strong> div.aligncenter</strong> {<br />
margin-left: auto;<br />
margin-right: auto;<br />
}<br />
<span style="color: #3366ff;"> /* This sets the border around the image itself, and the white (or light grey in this case) section around the image */</span><br />
<strong> .entry img, .entrytext img</strong> {<br />
border: 1px solid #b0b0b0;<br />
margin: 5px;<br />
padding: 5px;<br />
background-color: #f5f5f5;<br />
<span style="color: #3366ff;">/* Change the background colour as you like, e.g &#8216;white&#8217; or &#8216;black&#8217; (without the #) */</span><br />
}<br />
<span style="color: #3366ff;"> /* This sets the image border colour to be different when hovering the mouse over an image that is linked to something */</span><br />
<strong> .entry a:hover img, .entrytext a:hover img</strong> {<br />
border: 1px solid #505050;<br />
}</p>
<p>If you have any issues implementing this, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kublermdk.com/2008/11/17/wordpress-properly-captioned-images/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

