<?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"
	>

<channel>
	<title>Keith Millington</title>
	<atom:link href="http://www.keithmillington.co.uk/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.keithmillington.co.uk/wordpress</link>
	<description>A website promoting the web development activities of Keith Millington; hand-coding in (X)HTML and CSS in accordance with web standards as defined by the W3C.</description>
	<pubDate>Tue, 24 Aug 2010 14:35:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Display an Event or Gig List Using Wordpress</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=22</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=22#comments</comments>
		<pubDate>Tue, 24 Jun 2008 12:50:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Wordpress Development]]></category>

		<guid isPermaLink="false">http://www.keithmillington.co.uk/wordpress/?p=22</guid>
		<description><![CDATA[<p>Want to use Wordpress to display an event or gig list with future dates, without resorting to a plug-in? This method allows my clients to manage their own gig / event list by simply creating events as individual Wordpress posts in a particular category ...</p>]]></description>
			<content:encoded><![CDATA[<p class="bold">Want to use Wordpress to display an event or gig list with future dates, without resorting to a plug-in?</p>
<p class="bold">This method allows my clients to manage their own gig / event list by simply creating events as individual Wordpress posts in a particular category - for sake of argument let&#8217;s assume a category entitled &#8216;Gigs&#8217;. The code then takes posts from this &#8216;Gigs&#8217; category and displays them - past and present - in a listing.</p>
<p>Now this was always possible for past (published) post dates, but clearly that is not of much use in this situation, since the whole point of a gig or event list is to advertise future events, rather than past events. Fortunately, since the advent of Wordpress 2.xx (not quite sure what version of 2 - to be safe use the latest version), you are now able to display future (scheduled) posts and it&#8217;s this functionality that I exploit to display a gig / event listing.</p>
<p>A later refinement has two headings on the web page, &#8216;Gigs&#8217; and &#8216;Previous Gigs&#8217;; once the gig / event date has passed and the scheduled post becomes a published post, it dynamically moves from below the &#8216;Gigs&#8217; heading and reappears below the &#8216;Previous Gigs&#8217; heading. Sweet!!</p>
<h4>Examples</h4>
<p><img height="279" title="Image of gig list at www.willsfargo.info" alt="Image of Wills Fargo gig list" src="../images/willsgigs.jpg" width="660" border="0" /></p>
<p>Links to live examples &#8230;<br />
<a href="http://www.heathersimmons.co.uk/gigs.php">http://www.heathersimmons.co.uk/gigs.php</a><br />
<a href="http://www.digbyfairweather.com/gigs/">http://www.digbyfairweather.com/gigs/</a></p>
<p>Notice how the &#8216;Gigs&#8217; events are ordered in chronological (ascending) order with the next event at the top of the page and future events further down the page. As the top most event date passes, it dynamically drops down the page and reappears beneath the &#8216;Previous Gigs&#8217; heading and the next dated event is then displayed at the top of the page under the &#8216;Gigs&#8217; heading. The &#8216;Previous Gigs&#8217; are listed in reverse chronological (descending) order.</p>
<p>Q: Why display past gigs / events at all?<br />
A: Well, I&#8217;ve found that some artistes like their punters to see which of the more salubrious venues they&#8217;ve recently performed at - particularly if they&#8217;ve just played the 100 Club, or Ronnie Scotts, for example.</p>
<p>This is how it works &#8230;</p>
<h4>Display Past Events</h4>
<p>As mentioned earlier, it has always been possible to display a list of past events (published posts) - after all this is pretty much the anatomy of a blog. So to display only past posts from the &#8216;Gigs&#8217; category - ie previous events / gigs &#8230;</p>
<pre>
&lt;h2&gt;Previous Gigs&lt;/h2&gt;

&lt;?php
$my_query = new WP_Query('category_name=gigs');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?&gt;

&lt;dl class="giglist"&gt;
&lt;dt&gt;&lt;?php the_time('l, F jS, Y') ?&gt;:&lt;/dt&gt;
&lt;dd&gt;&lt;?php the_content(); ?&gt;&lt;/dd&gt;
&lt;/dl&gt;

&lt;?php endwhile;?&gt;
</pre>
<p>Note how the &#8216;WP_Query&#8217; function is used to query only for posts in the &#8216;gigs&#8217; category:<br />
WP_Query(&#8217;category_name=gigs&#8217;);<br />
Then the results are displayed in a definition list - with a class of &#8216;giglist&#8217; to enable future styling.</p>
<h4>Display Future Events</h4>
<p>However, to display future dates (scheduled posts) from the &#8216;Gigs&#8217; category, I exploit the &#8216;post_status=future&#8217; function which became available within Wordpress 2.xx &#8230;</p>
<pre>
&lt;h2&gt;Gigs&lt;/h2&gt;

&lt;?php
$my_query = new WP_Query('category_name=gigs&#038;post_status=future&#038;order=ASC');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?&gt;

&lt;dl class="giglist"&gt;
&lt;dt&gt;&lt;?php the_time('l, F jS, Y') ?&gt;:&lt;/dt&gt;
&lt;dd&gt;&lt;?php the_content(); ?&gt;&lt;/dd&gt;
&lt;/dl&gt;

&lt;?php endwhile;?&gt;
</pre>
<p>Note how this time the &#8216;WP_Query&#8217; function queries only posts with a post status of &#8216;future&#8217; in the &#8216;gigs&#8217; category and also specifies that they are listed in ascending (ASC) order:<br />
WP_Query(&#8217;category_name=gigs&#038;post_status=future&#038;order=ASC&#8217;);<br />
Again the results are displayed in a definition list - with a class of &#8216;giglist&#8217; to enable future styling.</p>
<h4>Complete Code</h4>
<p>Of course, it makes more sense to have your future gigs / events at the top of the page where they are most visible and previous gigs further down the page. So the final code would be &#8230;</p>
<pre>
&lt;h2&gt;Gigs&lt;/h2&gt;

&lt;?php
$my_query = new WP_Query('category_name=gigs&#038;post_status=future&#038;order=ASC');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?&gt;

&lt;dl class="giglist"&gt;
&lt;dt&gt;&lt;?php the_time('l, F jS, Y') ?&gt;:&lt;/dt&gt;
&lt;dd&gt;&lt;?php the_content(); ?&gt;&lt;/dd&gt;
&lt;/dl&gt;

&lt;?php endwhile;?&gt;

&lt;h2&gt;Previous Gigs&lt;/h2&gt;

&lt;?php
$my_query = new WP_Query('category_name=gigs');
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID;
?&gt;

&lt;dl class="giglist"&gt;
&lt;dt&gt;&lt;?php the_time('l, F jS, Y') ?&gt;:&lt;/dt&gt;
&lt;dd&gt;&lt;?php the_content(); ?&gt;&lt;/dd&gt;
&lt;/dl&gt;

&lt;?php endwhile;?&gt;
</pre>
<h4>A Touch of CSS</h4>
<p>Now, all that that remains is to add that touch of style:</p>
<pre>
h2 {
font: 120% Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
}

.giglist {
font: 80% Verdana, Arial, Helvetica, sans-serif;
margin: 0 0 0 10px; padding: 0;
list-style-type: none;
 }

.giglist p {
margin: 0; padding: 0;
}

.giglist dl {
margin: 0; padding: 0;
list-style-type: none;
}

.giglist dt {
margin: 0; padding: 0 20px 0px 20px;
font-size: 90%; font-weight: bold;
background: url(http://www.stylegala.com/img/_bullets/0093_bullet.png)
no-repeat 0 50%;
}

.giglist dd {
margin: 0 0 19px 0; padding: 0 20px 0px 20px;
}
</pre>
<h4>In Closing</h4>
<p>The precise time of day at which an event dynamically moves between &#8216;Gigs&#8217; and &#8216;Previous Gigs&#8217; can be manipulated by adjusting the post&#8217;s time parameter. If it&#8217;s an evening event I tend to set the time to around 22.00hrs or 23.00hrs. This way the event is listed under the &#8216;Gigs&#8217; heading all through the day and only transfers to the &#8216;Previous Gigs&#8217; heading when it&#8217;s too late to be advertised under that day&#8217;s events. After all, there&#8217;s little point punters turning up to a gig if the drummer&#8217;s already loading his kit into the van!!</p>
<p>I&#8217;ve used definition lists as a means of displaying these events - now, should I have used unordered lists instead? I guess it comes down to your take on the W3C directives. However, if unordered lists, or even tables (since it&#8217;s tabular data) are your preference, then these layouts are easily implemented.</p>
<p>There&#8217;s a setting in Wordpress, &#8216;Blog pages show at most&#8217; which determines the maximum number of posts displayed on a page. The default setting of 10 will need to be increased if you intend displaying more than 10 gigs / events on your page.<br />
In WP version 2.3.x, it&#8217;s here: Options / Reading / Blog Pages / Show at most.<br />
In WP version 2.5.x, it&#8217;s here: Settings / Reading / Blog pages show at most.</p>
<p>For alternative bullets - look here:<br />
<a href="http://www.stylegala.com/features/bulletmadness/">http://www.stylegala.com/features/bulletmadness/</a></p>
<p>Thanks to &#8216;mfields&#8217; of the Wordpress community who put me on to the idea of exploiting the &#8216;post_status=future&#8217; function in the first place.</p>
<p>And blog&#8217;s your proverbial uncle!!</p>
<h4>Appendix 1</h4>
<p>Display a message if no future gigs exist - thanks to KayBee for thinking of this - a useful refinement I think. Seagyn Davis has the answer - an if statement with the have_posts().</p>
<p>I&#8217;d do it like this I think &#8230;</p>
<pre>
&lt;h2&gt;Gigs&lt;/h2&gt;

&lt;?php
$my_query = new WP_Query('category_name=gigs&#038;post_status=future&#038;order=ASC');
?&gt;

&lt;?php
if ($my_query->have_posts()) : while ($my_query->have_posts()) :
$my_query->the_post();
$do_not_duplicate = $post->ID;
?&gt;

&lt;dl class="giglist"&gt;
&lt;dt&gt;&lt;?php the_time('l, F jS, Y') ?&gt;:&lt;/dt&gt;
&lt;dd&gt;&lt;?php the_content(); ?&gt;&lt;/dd&gt;
&lt;/dl&gt;

&lt;?php endwhile; else: ?&gt;
&lt;p&gt;&lt;?php _e('Sorry, no shows at present.'); ?&gt;&lt;/p&gt;
&lt;?php endif; ?&gt;
</pre>
<p>I&#8217;ve tried it here and it seems to work:<br />
<a href="http://www.willsfargo.info/gigs.php">http://www.willsfargo.info/gigs.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=22</wfw:commentRss>
		</item>
		<item>
		<title>Bits and Bytes</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=20</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=20#comments</comments>
		<pubDate>Tue, 03 Jun 2008 09:02:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mumbo Jumbo]]></category>

		<guid isPermaLink="false">http://www.keithmillington.co.uk/wordpress/?p=20</guid>
		<description><![CDATA[Nothing to do with web development, but a topic that seems to be widely misunderstood relating to Internet connection speed ...

Question: My server provider, Talk Talk, advertise 'Up to 8 Meg download speeds'. What does this actually mean?]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>Digby Fairweather</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=19</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=19#comments</comments>
		<pubDate>Thu, 22 May 2008 12:58:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Wordpress Development]]></category>

		<guid isPermaLink="false">http://keithmillington.dreamhosters.com/wordpress/?p=19</guid>
		<description><![CDATA[Digby became a fulltime jazzman in l977 after twelve years as a qualified librarian in Southend-on-Sea. From l973 he worked his way up as a part-timer through established bands including Hugh Rainey, Eggy Ley, Eric Silk, Keith Nichols ...]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
		<item>
		<title>Heather Simmons</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=12</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=12#comments</comments>
		<pubDate>Tue, 29 May 2007 13:43:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Website Portfolio]]></category>

		<guid isPermaLink="false">http://www.keithmillington.co.uk/wordpress/?p=12</guid>
		<description><![CDATA[Heather 'Doll-face' Simmons, jazz chanteuse and impressario; take a look at Heather's website for information relating to gigs and recordings and listen to tracks from her recently recorded CD 'I'm Old Fashioned', which is receiving rave reviews and national radio airplay.

<a href="../wordpress/?p=12" title="Go to Heather's page"><img title="Go to Heather's page" height="120" alt="Image of Heather's website" src="../images/heather400.png" width="400" border="0" /></a>]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>Accessibility and How it Affects You</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=11</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=11#comments</comments>
		<pubDate>Tue, 29 May 2007 06:23:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mumbo Jumbo]]></category>

		<guid isPermaLink="false">http://keithmillington.dreamhosters.com/wordpress/?p=11</guid>
		<description><![CDATA[<p>As the owner of a website, you now have a legal obligation - following the implementation of section 21 of the Disability Discrimination Act - to make reasonable adjustments to ensure blind and partially sighted people can access your service.</p>]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>Incurably Semantic</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=10</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=10#comments</comments>
		<pubDate>Mon, 28 May 2007 19:09:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mumbo Jumbo]]></category>

		<guid isPermaLink="false">http://keithmillington.dreamhosters.com/wordpress/?p=10</guid>
		<description><![CDATA[Semantic markup and search engine optimisation: there's much nonsense talked about search engine optimisation (SEO), largely relating to the out of date over-use of META tags.]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>Faux Columns</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=9</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=9#comments</comments>
		<pubDate>Mon, 28 May 2007 19:08:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mumbo Jumbo]]></category>

		<guid isPermaLink="false">http://keithmillington.dreamhosters.com/wordpress/?p=9</guid>
		<description><![CDATA[Why use faux columns? Well, until CSS is fully supported by all grown up browsers, and yes, this is a thinly veiled dig at IE/Win's half-hearted attempt to support Web Standards, I really do have better ways to spend my time than worrying about pixel perfect placement of columns (IE/Win's '3 pixel jog in contiguous float' bug), and of course, the equal length floated columns dilemma presented by CSS.]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Tableless Design</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=8</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=8#comments</comments>
		<pubDate>Mon, 28 May 2007 19:08:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mumbo Jumbo]]></category>

		<guid isPermaLink="false">http://keithmillington.dreamhosters.com/wordpress/?p=8</guid>
		<description><![CDATA[The W3C states that tables should only be used for the presentation of tabular data. This site uses no tables whatsoever, and instead uses CSS for it's layout.]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=8</wfw:commentRss>
		</item>
		<item>
		<title>About This Site</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=7</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=7#comments</comments>
		<pubDate>Mon, 28 May 2007 19:07:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Mumbo Jumbo]]></category>

		<guid isPermaLink="false">http://keithmillington.dreamhosters.com/wordpress/?p=7</guid>
		<description><![CDATA[For those interested, this site is constructed using XHTML 1.0 Transitional and Cascading Style Sheets. The layout is achieved purely through style sheets, and as such, uses no tables for it's presentation - look Mum, no tables!]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>Digby Dog Blog</title>
		<link>http://www.keithmillington.co.uk/wordpress/?p=16</link>
		<comments>http://www.keithmillington.co.uk/wordpress/?p=16#comments</comments>
		<pubDate>Wed, 02 May 2007 16:01:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Wordpress Development]]></category>

		<guid isPermaLink="false">http://localhost:8888/getalife/wordpress/?p=16</guid>
		<description><![CDATA[Hello fellow bloggers, my name is Digby and I am a remarkably intelligent and good looking collie cross aka ‘The Best Dog In The World’.]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.keithmillington.co.uk/wordpress/?feed=rss2&amp;p=16</wfw:commentRss>
		</item>
	</channel>
</rss>
