<?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>the second phase &#187; Galleries</title>
	<atom:link href="http://www.phase2.net/tag/galleries/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phase2.net</link>
	<description>confessions of a geek</description>
	<lastBuildDate>Wed, 04 Aug 2010 07:11:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Gallery tutorial</title>
		<link>http://www.phase2.net/2008/07/23/wordpress-gallery-tutorial/</link>
		<comments>http://www.phase2.net/2008/07/23/wordpress-gallery-tutorial/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 03:15:51 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Galleries]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.phase2.net/?p=458</guid>
		<description><![CDATA[With the release of Wordpress 2.5 awhile back, they introduced the &#8216;gallery&#8217; shortcode.  The gallery shortcode takes all the media attachments and creates a nicely laid out gallery, thumbnails and all.  The problem with it is that it doesn&#8217;t do much more then that, unless of course your theme supports it.  It shows the attachment [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of Wordpress 2.5 awhile back, they introduced the &#8216;gallery&#8217; shortcode.  The gallery shortcode takes all the media attachments and creates a nicely laid out gallery, thumbnails and all.  The problem with it is that it doesn&#8217;t do much more then that, unless of course your theme supports it.  It shows the attachment and that&#8217;s basically it.  No navigation, no special listing of galleries, nada.</p>
<p>One of the problems I&#8217;ve found with Wordpress is that it&#8217;s somewhat difficult to really implement good galleries that stick with the theme.  I&#8217;ve tried Gallery2/WPG and some others and I&#8217;ve even gone the route of trying to have a completely separate gallery or photo blog.  Nothing really made me that happy.  I like the theme I have currently, so I wasn&#8217;t looking forward to finding a new one or actually hacking a new theme together to support the galleries better.  So last weekend I sat down and got my hands dirty.<br />
<span id="more-458"></span><br />
There were a couple goals I had for this project.
<ul>
<li>Better navigation when you were viewing a photo in the gallery</li>
<li>EXIF data on the image page</li>
<li>A special format for any gallery type post</li>
<li>A listing of all the galleries</li>
</ul>
<p>I first started off with what I thought was the easiest &#8211; better navigation in the galleries.  When WP displays the gallery page, it looks for a couple templates, the first being image.php, then attachment.php and then some others.  I went into my theme and created a image.php file.  I also brought up the Default theme&#8217;s image.php to get somewhat of an idea of what I needed.</p>
<p>Basically, the image.php is the same as a single page, it&#8217;s just displaying different content.  First I&#8217;ll post the entire image.php and then explain what I was doing.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;div id=&quot;content_gallery&quot;&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
    &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
      &lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rev=&quot;attachment&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt; &lt;/h2&gt;
      &lt;div class=&quot;gallery_entry&quot;&gt;
      <span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #000088;">$parent</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span>get_children<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$attachment</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span>
          <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$next</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$k</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$prev</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$k</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$next_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$prev_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$next</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$next_exists</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$next_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$next</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt; next image &gt;&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$img_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$next</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$prev</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$prev_exists</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$prev_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$prev</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt; &lt;&lt; previous image&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">if</span>  <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$next_exists</span><span style="color: #009900;">&#41;</span>
          <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$img_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$prev</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$next_exists</span> and <span style="color: #339933;">!</span><span style="color: #000088;">$prev_exists</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$img_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$img_url</span> <span style="color: #339933;">=</span> wp_get_attachment_url<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/.*(/wp-content/uploads/S+.S+)/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$img_url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> 1<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$fn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/home/phasenet/public_html&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span>1<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$exif_data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">read_exif_data</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;p class=&quot;attachment&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$img_link</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'medium'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/p&gt;
        &lt;div class=&quot;caption&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p class=&quot;serif&quot;&gt;Read the rest of this entry &amp;raquo;&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;table id='photo-details'&gt;
          &lt;tr&gt;
            &lt;th&gt; Original Image: &lt;/th&gt;
            &lt;td&gt; &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$img_url</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'COMPUTED'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Width'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;x&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'COMPUTED'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Height'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> exif_filesize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'FileSize'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Camera: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Model'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Focal Length: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'FocalLength'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #b1b100;">print</span> exif_divide<span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'FocalLength'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                   <span style="color: #b1b100;">else</span>
                    <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Not available&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Aperture: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'COMPUTED'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ApertureFNumber'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Shutter: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ExposureTime'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ExposureTime'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                   <span style="color: #b1b100;">else</span>
                    <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Not available&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; ISO: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ImageInfo'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                  <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ImageInfo'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                   <span style="color: #b1b100;">else</span>
                  <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Not available&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
             &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
&nbsp;
        &lt;div class=&quot;navigation&quot;&gt;
          &lt;div class=&quot;alignleft&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$prev_link</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
          &lt;div class=&quot;alignright&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$next_link</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
        &lt;/div&gt;
        &lt;br class=&quot;clear&quot; /&gt;
&nbsp;
      &lt;/div&gt;
    &lt;/div&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_template<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;p&gt;Sorry, no attachments matched your criteria.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>No apologies for my code syntax or style. <img src='http://www.phase2.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />   In any case, we can start stepping through it.  As I said earlier, the image.php acts like single.php in that we&#8217;re actually getting <strong>the_post</strong>.  However, one thing that we need is the parent of this post ( ie &#8211; the gallery main page ), in order to get the children so we can create the navigation links.  We do this via the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$parent</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span>get_children<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now that we have all of the children posts ( or really, the other pictures in the gallery ), we have to figure out where in that list our current page is so that we can determine who is next and who was before us.  We&#8217;ll do this via a simple loop:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$attachment</span> <span style="color: #009900;">&#41;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$next</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$k</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$prev</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$k</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Pretty simple.  We loop until the ID in the list matches our current ID and then break out.  Add one, subtract one and we got our next and previous photos.  Now, the next code has to deal with some navigation quirks.  In my gallery, I wanted the user to be sent to the next photo if they actually clicked on the photo being displayed.  However, once they get to the end, it needs to send them back a photo since there is nowhere else to go.  The following code does just that.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$next</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$next_exists</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$next_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$next</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt; next image &gt;&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$img_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$next</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$prev</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$prev_exists</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$prev_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$prev</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt; &lt;&lt; previous image&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$next_exists</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$img_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$prev</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$next_exists</span> and <span style="color: #339933;">!</span><span style="color: #000088;">$prev_exists</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$img_link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span> <span style="color: #339933;">.</span> get_attachment_link<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Basically, we test to make sure there is another item after us in the list.  If there is, we set the image to shoot us to the next link, as well as create the link for our &#8216;next&#8217; navigation button and lastly, set a flag that there is a &#8216;next&#8217; photo.  We then test if there is a &#8216;previous&#8217; photo in the list and if there is, we set the &#8216;previous&#8217; navigation link and a flag gets turned on.  Then we test the state of the &#8216;next&#8217; flag, because if there isn&#8217;t another photo in the list to go to, we have to set the image&#8217;s link somewhere else.  In this case, we set it to the previous image if there is no next image.</p>
<p>Lastly, we check if either of the flags are set.  If neither of them were turned on, that means there is no next or previous photo to go to so we just set the image&#8217;s link to reference itself. </p>
<p>The last step of the main bulk of our php code is to get some EXIF data, which is basically data that some cameras embed into the photo.  PHP supports this if it&#8217;s compiled in so your web hosting vendor may or may not have this.  Mine does ( yay! ) so I was able to support this.  Here&#8217;s the code again:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$img_url</span> <span style="color: #339933;">=</span> wp_get_attachment_url<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/.*(/wp-content/uploads/S+.S+)/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$img_url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> 1<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$fn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/home/phasenet/public_html&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span>1<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$exif_data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">read_exif_data</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The <strong>read_exif_data</strong> function requires an actual filename and does not work with a URL unfortunately.  Because of this, I have to figure out where on the web host my file actually resides.  I do this by getting the URL from the attachment, then doing a small sanity check just to make sure that it matches the upload directory that Wordpress uses.  I then test the size of the result to make sure it&#8217;s more than 1.  preg_match basically returns the item matched against and then any matches that were captured.  If I receive a match, I create the filename and then just read in the exif data.</p>
<p>The last part of this is really just output.  I display my image and link it to the URL we created earlier.  You actually get the image via the <span class='p2code'>wp_get_attachment_image</span> function.  After that, I just create a table and display the data from my *$exif_data* array.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        &lt;p class=&quot;attachment&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$img_link</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'medium'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/p&gt;
        &lt;div class=&quot;caption&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p class=&quot;serif&quot;&gt;Read the rest of this entry &amp;raquo;&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;table id='photo-details'&gt;
          &lt;tr&gt;
            &lt;th&gt; Original Image: &lt;/th&gt;
            &lt;td&gt; &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$img_url</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'COMPUTED'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Width'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;x&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'COMPUTED'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Height'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> exif_filesize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'FileSize'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Camera: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Model'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Focal Length: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'FocalLength'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #b1b100;">print</span> exif_divide<span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'FocalLength'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                   <span style="color: #b1b100;">else</span>
                    <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Not available&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Aperture: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'COMPUTED'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ApertureFNumber'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; Shutter: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ExposureTime'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ExposureTime'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                   <span style="color: #b1b100;">else</span>
                    <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Not available&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;th&gt; ISO: &lt;/th&gt;
            &lt;td&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ImageInfo'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
                  <span style="color: #b1b100;">print</span> <span style="color: #000088;">$exif_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ImageInfo'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                   <span style="color: #b1b100;">else</span>
                  <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;Not available&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
             &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;</pre></td></tr></table></div>

<p>And last, but not least, I create the navigation links, print out the comments template and the footer of the page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        &lt;div class=&quot;navigation&quot;&gt;
          &lt;div class=&quot;alignleft&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$prev_link</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
          &lt;div class=&quot;alignright&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$next_link</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/div&gt;
        &lt;/div&gt;
        &lt;br class=&quot;clear&quot; /&gt;
&nbsp;
      &lt;/div&gt;
    &lt;/div&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_template<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;p&gt;Sorry, no attachments matched your criteria.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Next up is how I modified the gallery main page.</p>
<h3>Main Page &#8211; Gallery Posts</h3>
<p>So when I created a gallery, I wanted them to show up on the main page.  But I wanted them to just have an image from the gallery, a short snippet of text, how many images were in the gallery and a link to all my other galleries, which is alot different to how all the other posts are displayed. This meant I would be modifying the main index.php page.</p>
<p>Before I did this, however, I went into my admin panel and created a category called &#8216;Galleries&#8217; and then figured out the corresponding number for my category ( in my case, 25 ).</p>
<p>The reason I did this is because in the index.php, I created a small bit of logic that if a post was in category 25, display it differently.  Not too complicated!  So without further ado, here&#8217;s the index.php from my site. ( Again, sorry for any &#8216;bad&#8217; code )</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;con_pad&quot;&gt;
  &lt;div id=&quot;content&quot;&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000000; font-weight: bold;">function</span> stupid_hack<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;|&lt;/ul&gt;s*&lt;ul class='asides'&gt;|&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stupid_hack'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">27</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;ul class='asides'&gt;
            &lt;li id=&quot;p<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wptexturize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink: <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wptexturize<span style="color: #009900;">&#40;</span><span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;
            &lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_number<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(0 comments)'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'(1 comment)'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'(% comments)'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
            &lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(e)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
                &lt;div class=&quot;post-date&quot;&gt;&lt;span class=&quot;post-month&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-day&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;post-title&quot;&gt;
                  &lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
                &lt;/div&gt;
                &lt;div class='gallery-post'&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                  <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span>get_children<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC, ID ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                  <span style="color: #000088;">$num_pics</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
                &lt;/div&gt;
                &lt;div class='gallery-post-text'&gt;
                  <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                  This album has &lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num_pics</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> items&lt;/strong&gt;.&lt;br/&gt;  Check out my &lt;a href=&quot;/category/galleries&quot;&gt;other albums&lt;/a&gt;.
                &lt;/div&gt;
          &lt;/div&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
    &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
          &lt;div class=&quot;post-date&quot;&gt;&lt;span class=&quot;post-month&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-day&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/div&gt;
          &lt;div class=&quot;post-title&quot;&gt;
          &lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
                &lt;span class=&quot;post-cat&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-comments&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_popup_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Comments &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1 Comment &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% Comments &amp;#187;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class=&quot;entry&quot;&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;/div&gt;
        &lt;/div&gt;&lt;!--/post --&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;div class=&quot;navigation&quot;&gt;
          &lt;span class=&quot;previous-entries&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> next_posts_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Previous Entries'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;next-entries&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_posts_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Next Entries'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
        &lt;/div&gt;
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;h2&gt;Not Found&lt;/h2&gt;
        &lt;p&gt;Sorry, but you are looking for something that isn't here.&lt;/p&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
  &lt;/div&gt;&lt;!--/content --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>So let&#8217;s start.  First, we&#8217;ve just got some miscellaneous stuff that&#8217;s not too important.  I call the header and there is a hack in here for an issue with my asides.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;con_pad&quot;&gt;
  &lt;div id=&quot;content&quot;&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #000000; font-weight: bold;">function</span> stupid_hack<span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;|&lt;/ul&gt;s*&lt;ul class='asides'&gt;|&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stupid_hack'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Here&#8217;s where it gets interesting.  While I have posts to post ( heh ), I check the category the post is in.  Because I use the &#8216;asides&#8217; modification, I check for category 27.  I also want to make sure that I&#8217;m not currently displaying a single post, because if I were, I&#8217;d want it to look differently.  This assures that this style will only occur when a user is displaying all the posts on the page.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    while (have_posts()) : the_post(); ?&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">27</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;ul class='asides'&gt;
            &lt;li id=&quot;p<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wptexturize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Permalink: <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wptexturize<span style="color: #009900;">&#40;</span><span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;
            &lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_number<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(0 comments)'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'(1 comment)'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'(% comments)'</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/a&gt;
            &lt;span&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'(e)'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;</pre></td></tr></table></div>

<p>This isn&#8217;t a tutorial on asides, so let&#8217;s get to the next part in that code &#8211; when I check for category 25 and make sure that it&#8217;s not a single post viewing.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_single<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
                &lt;div class=&quot;post-date&quot;&gt;&lt;span class=&quot;post-month&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-day&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;post-title&quot;&gt;
                  &lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
                &lt;/div&gt;
                &lt;div class='gallery-post'&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                  <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span>get_children<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC, ID ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                  <span style="color: #000088;">$num_pics</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
                &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
                &lt;/div&gt;
                &lt;div class='gallery-post-text'&gt;
                  <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                  This album has &lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num_pics</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> items&lt;/strong&gt;.&lt;br/&gt;  Check out my &lt;a href=&quot;/category/galleries&quot;&gt;other albums&lt;/a&gt;.
                &lt;/div&gt;
          &lt;/div&gt;</pre></td></tr></table></div>

<p>If I find a post and it is in category 25, I create a nice little div ( I mostly copied from the regular posts code at the bottom for the first bit of design ).  The changes really come about when I create the &#8216;gallery-post&#8217; div. </p>
<p>My first bit of code is to grap all the attachments from the post, which I do by just telling it to grab all the children of my current post.  Then I get a quick sum of the amount of pictures collected.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>25
26
27
28
29
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                &lt;div class='gallery-post'&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                  <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span>get_children<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC, ID ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                  <span style="color: #000088;">$num_pics</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Next, I display the image and close out my div.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>30
31
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
                &lt;/div&gt;</pre></td></tr></table></div>

<p>I now create another div that will contain my text and here&#8217;s a small detail that is important.  I call <span class='p2code'>the_content()</span> with some arguments.  These arguments are important because I insert a <span class='p2code'>&lt;!&#8211;more&#8211;&gt;</span> tag into the post between the snippet and description.  I didn&#8217;t want WordPress inserting its &#8216;Read the rest of this entry&#8217; crap, so that&#8217;s why the first argument is nulled out.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>32
33
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                &lt;div class='gallery-post-text'&gt;
                  <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>I also set a style in my css style sheet that makes it display properly, but I don&#8217;t really want to go into the &#8216;design&#8217; factors right now.</p>
<p>After all that, I display the number of pictures in the gallery and my link to a category page, which is a wordpress ability to display all pages from a certain category.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>34
35
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                  This album has &lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num_pics</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> items&lt;/strong&gt;.&lt;br/&gt;  Check out my &lt;a href=&quot;/category/galleries&quot;&gt;other albums&lt;/a&gt;.
                &lt;/div&gt;</pre></td></tr></table></div>

<p>Then, if my post is not in category 25 or in category 27, I then display it as a normal post -</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
    &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
          &lt;div class=&quot;post-date&quot;&gt;&lt;span class=&quot;post-month&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-day&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/div&gt;
          &lt;div class=&quot;post-title&quot;&gt;
          &lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
                &lt;span class=&quot;post-cat&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-comments&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_popup_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Comments &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1 Comment &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% Comments &amp;#187;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class=&quot;entry&quot;&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;/div&gt;
        &lt;/div&gt;&lt;!--/post --&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
      <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;div class=&quot;navigation&quot;&gt;
          &lt;span class=&quot;previous-entries&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> next_posts_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Previous Entries'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;next-entries&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_posts_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Next Entries'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
        &lt;/div&gt;
&nbsp;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;h2&gt;Not Found&lt;/h2&gt;
        &lt;p&gt;Sorry, but you are looking for something that isn't here.&lt;/p&gt;
&nbsp;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
  &lt;/div&gt;&lt;!--/content --&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre></td></tr></table></div>

<p>I had some problems with the design of the gallery div and getting the text right, but it just took some mucking around with the css to get it right.</p>
<p>Now onto the listing of galleries!</p>
<h3>List of Galleries</h3>
<p>My next item of business was to create a way to list all of my galleries.  This is relatively easy because WordPress, the great tool that it is, already has a way to quickly display all posts that fall into a certain category.  The problem I had was that when it happens, the posts were not displaying how they had on the main page.  Instead, they were just displaying short snippets of text.  Like the image.php, WordPress has a way for you to create certain pages that will be called when displaying a specific category.  In order to do this, you create a page called &#8216;category-#.php&#8217;, where the # corresponds to your category number.  So I created a &#8216;category-25.php&#8217; file and got to editing.  This is what it ended up looking like.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;div id=&quot;con_pad&quot;&gt;
  &lt;div id=&quot;content&quot;&gt;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span>
                  <span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span>get_children<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'order'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC, ID ASC'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                  <span style="color: #000088;">$num_pics</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span>
          &lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
                &lt;div class=&quot;post-date&quot;&gt;&lt;span class=&quot;post-month&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'M'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-day&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/div&gt;
                &lt;div class=&quot;post-title&quot;&gt;
                  &lt;h2&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/h2&gt;
                  &lt;span class=&quot;post-cat&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; &lt;span class=&quot;post-comments&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_popup_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Comments &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'1 Comment &amp;#187;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% Comments &amp;#187;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;
                &lt;/div&gt;
                &lt;div class='gallery-post'&gt;
                &lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
                &lt;/div&gt;
                &lt;div class='gallery-post-text'&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'FALSE'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                This album has &lt;strong&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$num_pics</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> items&lt;/strong&gt;.
                &lt;/div&gt;
          &lt;/div&gt;
          <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
          Sorry, there are no galleries to view.
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
  &lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>If you&#8217;ll notice, most of this code is the exact same from the category 25 code on the main page, because really, I wanted my gallery posts to look the same here as they did on the main page!  In fact, the only difference is that I don&#8217;t need the logic statements to check if these posts are in category 25 &#8211; Wordpress is already doing that for me.  Other then that, the code <strong>is</strong> the exact same code!  So really, I&#8217;ll skip the explanation here.</p>
<h3>The actual post</h3>
<p>I need to mention that I didn&#8217;t actually code anything special at all for the actual display of the gallery itself. That is all done via the Wordpress gallery shortcode.  The only thing I have to make sure to do is to use the <span class='p2code'>&lt;!&#8211;more&#8211;&gt;</pre>
<p> code between the short snippet of text and the actual description.  After the description, I simply put the gallery shortcode in and did a little css style sheet magic.</p>
<p>The last thing I had to do is to make sure to assign the post to my 'Galleries' category.  After that, nothing else was needed.</p>
<p>I hope people found this informative and I'm sorry it took so long to get out.  If you'd like a tarball of my theme so you can poke around with it, please just send me an email at hajducko at gmail.com and as always, comments welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phase2.net/2008/07/23/wordpress-gallery-tutorial/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Wine Wonderland</title>
		<link>http://www.phase2.net/2008/07/20/wine-wonderland/</link>
		<comments>http://www.phase2.net/2008/07/20/wine-wonderland/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 05:57:43 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[Galleries]]></category>
		<category><![CDATA[garett]]></category>
		<category><![CDATA[jen]]></category>
		<category><![CDATA[wine]]></category>

		<guid isPermaLink="false">http://www.phase2.net/?p=420</guid>
		<description><![CDATA[Jen and Garett hosted a wine party for Jen&#8217;s 30th birthday.

These are some older photos that I&#8217;m posting up now that I&#8217;ve got some decent galleries going.  
]]></description>
			<content:encoded><![CDATA[<p>Jen and Garett hosted a wine party for Jen&#8217;s 30th birthday.</p>
<p><span id="more-420"></span></p>
<p>These are some older photos that I&#8217;m posting up now that I&#8217;ve got some decent galleries going.  </p>

<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0410/' ><img width="150" height="112" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0410-150x112.jpg" class="attachment-thumbnail" alt="" title="img_0410" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0412/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0412-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0412" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0416/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0416-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0416" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0417/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0417-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0417" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0420/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0420-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0420" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0423/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0423-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0423" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0424/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0424-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0424" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0426/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0426-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0426" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0427/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0427-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0427" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0429/' ><img width="150" height="112" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0429-150x112.jpg" class="attachment-thumbnail" alt="" title="img_0429" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0430/' ><img width="150" height="112" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0430-150x112.jpg" class="attachment-thumbnail" alt="" title="img_0430" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0431/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0431-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0431" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0434/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0434-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0434" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0435/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0435-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0435" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0436/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0436-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0436" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0437/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0437-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0437" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0440/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0440-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0440" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0441/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0441-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0441" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0443/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0443-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0443" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0445/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0445-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0445" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0446/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0446-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0446" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0449/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0449-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0449" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0450/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0450-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0450" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0452/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0452-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0452" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0453/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0453-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0453" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0454/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0454-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0454" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0455/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0455-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0455" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0456/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0456-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0456" /></a>
<a href='http://www.phase2.net/2008/07/20/wine-wonderland/img_0461/' ><img width="112" height="150" src="http://www.phase2.net/wp-content/uploads/2008/07/img_0461-112x150.jpg" class="attachment-thumbnail" alt="" title="img_0461" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.phase2.net/2008/07/20/wine-wonderland/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gallery EXIF data</title>
		<link>http://www.phase2.net/2008/07/19/gallery-exif-data/</link>
		<comments>http://www.phase2.net/2008/07/19/gallery-exif-data/#comments</comments>
		<pubDate>Sat, 19 Jul 2008 08:26:24 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[Galleries]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://www.phase2.net/?p=333</guid>
		<description><![CDATA[I noticed that some of the gallery pics are a bit tiny &#8211; I&#8217;ll be updating the individual pages to display EXIF data for the photo as well as a link where you can download the original image.  Too tired to do that right now.
]]></description>
			<content:encoded><![CDATA[<p>I noticed that some of the gallery pics are a bit tiny &#8211; I&#8217;ll be updating the individual pages to display EXIF data for the photo as well as a link where you can download the original image.  Too tired to do that right now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phase2.net/2008/07/19/gallery-exif-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
