<?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>BlackBox Technologies (BlackBox)&#187; Tutorials ArchivesWordPress Gallery Tutorial (as seen on Ma.tt) &#8211; BlackBox Technologies</title>
	<atom:link href="http://blackbox-tech.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://blackbox-tech.com</link>
	<description>BlackBox Technologies (BlackBox) is a web-presence service provider and trusted IT advisor to individuals and small-to-medium businesses.</description>
	<lastBuildDate>Fri, 30 Jul 2010 00:22:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress Gallery Tutorial (as seen on Ma.tt)</title>
		<link>http://blackbox-tech.com/blog/wordpress-gallery-tutorial-as-seen-on-matt/</link>
		<comments>http://blackbox-tech.com/blog/wordpress-gallery-tutorial-as-seen-on-matt/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 18:07:54 +0000</pubDate>
		<dc:creator>Scott Ellis</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blackbox-tech.com/?p=99</guid>
		<description><![CDATA[I&#8217;ve seen a lot of people who use WordPress asking how to create a gallery similar to the one on Matt Mullenweg&#8217;s website (Ma.tt) using nothing but core WordPress functionality. Fortunately, it&#8217;s much easier than  it looks and with just a few simple steps you can have a gallery of albums and images up an [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen a lot of people who use <a title="WordPress" href="http://www.wordpress.org" target="_blank">WordPress</a> asking how to create a gallery similar to the one on <a title="Matt Mullenweg" href="ma.tt" target="_blank">Matt Mullenweg&#8217;s website</a> (<a title="Matt mullenweg" href="http://ma.tt">Ma.tt</a>) using nothing but core WordPress functionality. Fortunately, it&#8217;s much easier than  it looks and with just a few simple steps you can have a gallery of albums and images up an running in no time. What you&#8217;ll end up with is the following:</p>
<ol>
<li><strong>A Gallery category</strong></li>
<li><strong>A custom category template w/a custom field for the &#8220;Thumbnail&#8221; Album image</strong></li>
<li><strong>A little extra CSS</strong></li>
<li><strong>Creation of an Album and added images!</strong></li>
</ol>
<p><strong>Step 1: Gallery Category<br />
</strong></p>
<p>The first step is as simple as making a new Category in WordPress called &#8220;Gallery&#8221;</p>
<p>Once you have created that category, mouse over the title and look at the <strong>bottom left</strong> of your browser for the URL. <strong>You will need to remember the ID number of the Gallery Category. </strong></p>
<p><em>The URL should look like http://www.yourdomain.com/wp-admin/categories.php?action=edit&amp;cat_<strong>ID=3</strong></em></p>
<p><strong>Step 2: Creating a Custom Category Template<br />
</strong></p>
<p>Thanks to the WordPress template hierarchy we can create custom templates for specific categories we want to display differently. In this case create a new php file in your favorite editor and call it &#8220;category-x.php&#8221; replacing the &#8220;x&#8221; with the ID number of your Gallery category from step 1. So if your Gallery ID is 3 your template will be category-3.php.</p>
<p>Next open the theme editor in WordPress and copy all of the code in the &#8220;category.php&#8221; template. If you don&#8217;t have a category.php template then copy the code in the &#8220;index.php&#8221; template.</p>
<p>If you are not familiar with WordPress templates then the next part might seem tricky so pay close attention. If you are familiar with them this will be a remedial of an explanation.</p>
<p>Paste the code you just copied into the category-x.php file we have open on your computer, all of it. Next, delete the content specific sections. That means that you want to keep the stuff like:</p>
<p>&lt;?php get_header(); ?&gt;</p>
<p>&lt;div id=&#8221;content&#8221;&gt;</p>
<p>&lt;div id=&#8221;contentleft&#8221;&gt;</p>
<p>&lt;!&#8211; logic and template stuff will go here &#8211;&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;?php include(TEMPLATEPATH.&#8221;/sidebar.php&#8221;);?&gt;</p>
<p>&lt;!&#8211; The main column ends  &#8211;&gt;</p>
<p>&lt;?php get_footer(); ?&gt;</p>
<p>Your specific layout might use different tags (like &lt;div id=&#8221;wrapper&#8221;&gt;, etc&#8230;) so make sure you keep the base layout stuff and just get rid of the code that creates the content in that template. If this still doesn&#8217;t make sense post a link in the <a title="BlackBox Support Forum" href="http://www.blackbox-tech.com/support">Blackbox Support Forum</a> and we&#8217;ll try to answer you as soon as we can.</p>
<p>Next, add the following code to your new template, in the case above where the &lt;!&#8211; logic and template stuff goes here &#8211;&gt; is.</p>
<p>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;</p>
<p>&lt;div id=&#8221;gallerypost&#8221;&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221;&gt;&lt;img src=&#8221;&lt;?php echo get_post_meta($post-&gt;ID, &#8220;gallery thumbnail&#8221;, true); ?&gt;&#8221; alt=&#8221;&lt;?php echo get_post_meta($post-&gt;ID, &#8220;gallery thumbnail&#8221;, true); ?&gt; Gallery&#8221; height=&#8217;150&#8242; border=&#8217;0&#8242; align=&#8217;left&#8217; style=&#8217;margin-left: 5px; margin-right: 5px;&#8217; /&gt;&lt;/a&gt;<br />
&lt;h1 style=&#8221;margin:0px 0px 2px 10px;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;&lt;?php the_excerpt(); ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php endwhile; else: ?&gt;</p>
<p>&lt;p&gt;&lt;?php _e(&#8216;Sorry, no posts matched your criteria.&#8217;); ?&gt;&lt;/p&gt;</p>
<p>&lt;?php endif; ?&gt;</p>
<p>In completion your custom category-<em>x</em>.php template should look like:</p>
<p>&lt;?php get_header(); ?&gt;</p>
<p>&lt;div id=&#8221;content&#8221;&gt;</p>
<p>&lt;div id=&#8221;contentleft&#8221;&gt;</p>
<p>&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;</p>
<p>&lt;div id=&#8221;gallerypost&#8221;&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221;&gt;&lt;img src=&#8221;&lt;?php echo get_post_meta($post-&gt;ID, &#8220;gallery thumbnail&#8221;, true); ?&gt;&#8221; alt=&#8221;&lt;?php echo get_post_meta($post-&gt;ID, &#8220;gallery thumbnail&#8221;, true); ?&gt; Gallery&#8221; height=&#8217;100&#8242; border=&#8217;0&#8242; align=&#8217;left&#8217; style=&#8217;margin-left: 5px; margin-right: 5px;&#8217; /&gt;&lt;/a&gt;<br />
&lt;h1 style=&#8221;margin:0px 0px 2px 10px;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;&lt;?php the_excerpt(); ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php endwhile; else: ?&gt;</p>
<p>&lt;p&gt;&lt;?php _e(&#8216;Sorry, no posts matched your criteria.&#8217;); ?&gt;&lt;/p&gt;</p>
<p>&lt;?php endif; ?&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;?php include(TEMPLATEPATH.&#8221;/sidebar.php&#8221;);?&gt;</p>
<p>&lt;!&#8211; The main column ends  &#8211;&gt;</p>
<p>&lt;?php get_footer(); ?&gt;</p>
<p><a title="WordPress Gallery Category Template" href="http://blackbox-tech.com/wp-content/uploads/2009/02/category-x-template-for-wp-gallery.zip">Download a copy of the above template (zip file)</a></p>
<p>The last step is to upload (via ftp) that custom template to your site: <em>http://www.yourdomain.com/wp-content/themes/theme-you-are-using/</em></p>
<p>WordPress will know to automatically start using that template for your gallery category now (assuming you used the right ID #).</p>
<p><strong>Step 3: A little Extra CSS</strong></p>
<p>Add the following to our style.css template:</p>
<p>#gallerypost {<br />
background: #FFFFFF;<br />
float: left;<br />
width: 530px;<br />
margin: 0px 0px 10px 0px;<br />
padding: 10px 10px 10px 10px;<br />
}</p>
<p>You might want to adjust the properties to make it look just like you want but that is the jist.</p>
<p>If you want a boarder around the album image add the following to style.css right after #gallerypost. (In this case a blue border).</p>
<p>#gallerypost img {</p>
<p>border: 1 px double #0000FF;</p>
<p>}</p>
<p><strong>Step 4: Create an Album and Add Images</strong></p>
<p>Add a new post and give it a title that describes the images that will be in the gallery.</p>
<p>Upload your images through the WordPress Image uploader.</p>
<p><a href="http://blackbox-tech.com/wp-content/uploads/2009/02/wordpress-buttons.jpg"><img class="size-full wp-image-124 alignnone" title="wordpress-buttons" src="http://blackbox-tech.com/wp-content/uploads/2009/02/wordpress-buttons.jpg" alt="wordpress-buttons" width="559" height="184" /></a></p>
<p>While in the Image Uploader select the image you want to represent your gallery.</p>
<p>If you are using Firefox, right click the square thumbnail WordPress has created for you and select &#8220;Copy Image Location.&#8221;</p>
<p><strong>If using IE</strong>, click the button below for Link to &#8220;File URL&#8221; and copy the url.In this case you will need to add &#8220;<strong>-150&#215;150</strong>&#8221; right before the file extension so your url should look like this:</p>
<p><em>http://www.yourdomain.com/wp-content/uploads/2009/02/imagename<strong>-150&#215;150</strong>.jpg</em></p>
<p>Switch to HTML mode in your editor in WordPress and enter the gallery shortcode:</p>
<p>[ gallery columns="4" ]</p>
<p>Below the post editing window is a section called &#8220;Custom Fields,&#8221; type &#8220;<strong>gallery thumbnail</strong>&#8221; in the &#8220;Name&#8221; field and in the &#8220;Value&#8221; box to it&#8217;s right paste the url to the thumbnail you just copied.</p>
<p>Save the post and go look at your site. Now all that is left is to add more &#8220;albms&#8221; and images and you are off and rolling.</p>
<p>To see an example implementation of this you can look at <a title="Dallas Junior Chamber  of Commerce" href="http://www.vsellis.com/category/gallery">http://www.vsellis.com/category/gallery/</a></p>
<p>Leave your commments below or if you need a little help visit us in our <a title="BlackBox Technologies Support Forum" href="http://www.blackbox-tech.com/support">support forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blackbox-tech.com/blog/wordpress-gallery-tutorial-as-seen-on-matt/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
	</channel>
</rss>
