<?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>Mystery Meat&#187; Tony Staffiero&#8217;s Mystery Meat Blog</title>
	<atom:link href="http://tonystaffiero.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tonystaffiero.com</link>
	<description>a little bit of everything</description>
	<lastBuildDate>Sat, 06 Mar 2010 01:23:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Displaying Posts with a custom event date using Flutter</title>
		<link>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/</link>
		<comments>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 21:12:46 +0000</pubDate>
		<dc:creator>Tones</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[flutter]]></category>

		<guid isPermaLink="false">http://www.tonystaffiero.com/?p=3</guid>
		<description><![CDATA[When I first heard about flutter at the Birmingham Wordcamp I was excited.  The project I was working on called for some custom fields, and I didn&#8217;t want the clients to worry if they typed a date in correctly.  Flutter can add a simple date selector when creating a post.  Since my knowledge of php [...]]]></description>
			<content:encoded><![CDATA[<p>When I first heard about flutter at the Birmingham Wordcamp I was excited.  The project I was working on called for some custom fields, and I didn&#8217;t want the clients to worry if they typed a date in correctly.  Flutter can add a simple date selector when creating a post.  Since my knowledge of php programming is very limited and I am new to Flutter I searched online for a solution.</p>
<p>For my events section of the site, two things needed to be met:</p>
<ol>
<li>All posts in the events category to be ordered by the most recent event date</li>
<li>All posts that are older than the current date to be excluded</li>
</ol>
<p>There&#8217;s a great article on Doc4design.com (<a href="http://www.doc4design.com/articles/articles/flutter-date-field/">http://www.doc4design.com/articles/articles/flutter-date-field/</a>) that explains a lot of the basic functions of Flutter along with inserting information from a custom Date field into wordpress. Also in this article is a link to php date display parameters.</p>
<p>This tutorial didn&#8217;t quite fit the clients needs so I searched the WordPress forums and found this <a href="http://wordpress.org/support/topic/288867?replies=5">http://wordpress.org/support/topic/288867?replies=5</a>.  The post outlines how to use the query_posts  function to compare a custom date with today&#8217;s date, and ruling out any posts older than today.  The trick is to get the Flutter date formatting to match up with the current date in the query_posts code. Here is my final query_posts with the loop to display events. I went with a shorthand month and date display such as  Jan 10th, Oct 1st, etc.</p>
<p><strong>Note:</strong> If you use this code make sure that your custom write field in flutter has the date format in the dropdown menu set to 4/20/08.</p>
<pre class="brush: php;">
 &lt;!-- Start the Loop. --&gt;

    &lt;?php
$today = date('Y-m-d');
query_posts('category_name=events&amp;meta_key=eventdate&amp;meta_compare=&gt;=&amp;meta_value='.$today.'&amp;orderby=meta_value&amp;order=ASC');
// special events query ... Doesn't show posts before current date
?&gt;

  &lt;?php while (have_posts()) : the_post(); ?&gt;

 &lt;!-- Display the Post's Content in a div box. --&gt;
 &lt;div class=&quot;entry&quot;&gt;
&lt;h4&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt; &lt;?php $thegottime = get('eventdate');
      $thetimestamp = strtotime($thegottime);
      echo date('M j', $thetimestamp);
      ?&gt;&lt;span class=&quot;date-suffix&quot;&gt;&lt;?php echo date('S', $thetimestamp); ?&gt;&lt;/span&gt; - &lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt;
   &lt;?php global $more;
$more = 0; ?&gt;
   &lt;?php the_content('&lt;br&gt;&lt;br&gt;  Read More...'); ?&gt;
 &lt;/div&gt;

 &lt;!-- REALLY stop The Loop. --&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
