<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Displaying Posts with a custom event date using Flutter</title>
	<atom:link href="http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/feed/" rel="self" type="application/rss+xml" />
	<link>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/</link>
	<description>a little bit of everything</description>
	<lastBuildDate>Wed, 20 Jan 2010 20:21:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Andrew</title>
		<link>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/comment-page-1/#comment-10</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 20 Jan 2010 20:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.tonystaffiero.com/?p=3#comment-10</guid>
		<description>Thanks Tony, this is just what I needed.</description>
		<content:encoded><![CDATA[<p>Thanks Tony, this is just what I needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tones</title>
		<link>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/comment-page-1/#comment-9</link>
		<dc:creator>Tones</dc:creator>
		<pubDate>Mon, 18 Jan 2010 20:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.tonystaffiero.com/?p=3#comment-9</guid>
		<description>I&#039;m not too sure if using slashes or dashes makes a difference with comparing the dates.  I think as long as the order and format is the same, they will compare correctly.

If you want to display certain data for the loop, just use the wordpress query_posts command &lt;a href=&quot;http://codex.wordpress.org/User:JamesVL/query_posts&quot; rel=&quot;nofollow&quot;&gt;http://codex.wordpress.org/User:JamesVL/query_posts&lt;/a&gt; 

Just use this snippet of code before the loop 
&lt;code&gt;&lt;?php  
$today = date(&#039;Y-m-d&#039;);  
query_posts(&#039;category_name=events&amp;meta_key=eventdate&amp;meta_compare=&gt;=&amp;meta_value=&#039;.$today.&#039;&amp;orderby=meta_value&amp;order=ASC&#039;);  ?&gt;&lt;/code&gt;

My flutter custom data key is named &quot;eventdate&quot; in the code. the meta compare function in the code will compare the current date with the flutter data and not display any past entries.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not too sure if using slashes or dashes makes a difference with comparing the dates.  I think as long as the order and format is the same, they will compare correctly.</p>
<p>If you want to display certain data for the loop, just use the wordpress query_posts command <a href="http://codex.wordpress.org/User:JamesVL/query_posts" rel="nofollow">http://codex.wordpress.org/User:JamesVL/query_posts</a> </p>
<p>Just use this snippet of code before the loop<br />
<code>< ?php<br />
$today = date('Y-m-d');<br />
query_posts('category_name=events&#038;meta_key=eventdate&#038;meta_compare=>=&#038;meta_value='.$today.'&#038;orderby=meta_value&#038;order=ASC');  ?></code></p>
<p>My flutter custom data key is named &#8220;eventdate&#8221; in the code. the meta compare function in the code will compare the current date with the flutter data and not display any past entries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Park</title>
		<link>http://tonystaffiero.com/displaying-posts-custom-event-date-using-flutter/comment-page-1/#comment-8</link>
		<dc:creator>John Park</dc:creator>
		<pubDate>Sun, 17 Jan 2010 05:35:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.tonystaffiero.com/?p=3#comment-8</guid>
		<description>Hi there,

I&#039;ve been trying to accomplish the same effect on my website&#039;s events section, but I can&#039;t seem to get the code working right. I have very minimal coding knowledge but from what it looks like, the date format is pulled from this php function date(&#039;Y-m-d&#039;) and compared against the flutter date format? You mentioned that the flutter format should be set to 4/20/08, but wouldn&#039;t that be written as (&#039;n/j/y&#039;) ?

Either way I can&#039;t seem to get it to display properly on my site. Currently I have been using some extra code in my functions.php file to keep the dates in the events category listed in order according to the flutter custom date key, I thought that perhaps this is overriding the above code?

This is what I&#039;m using in the functions file.

add_action(&#039;wp&#039;, &#039;check_category&#039;);
function check_category () {
	if (in_category(&#039;1&#039;)) {
		add_filter(&#039;get_previous_post_sort&#039;, &#039;sort_it&#039;);
		add_filter(&#039;get_next_post_sort&#039;, &#039;sort_it&#039;);
		add_filter(&#039;posts_orderby&#039;, &#039;sort_it&#039; );
		add_filter(&#039;posts_join&#039;, &#039;join_it&#039; );
		add_filter(&#039;posts_where&#039;, &#039;where_it&#039; );
 
		function sort_it () {
			global $wpdb;
 
			return &quot; $wpdb-&gt;postmeta.meta_value ASC &quot;;
		}
 
		function join_it( $join ) {
			global $wpdb;
 
			$join .= &quot; LEFT JOIN $wpdb-&gt;postmeta ON($wpdb-&gt;posts.ID = $wpdb-&gt;postmeta.post_id) &quot;;
 
		  return $join;
		}
 
		function where_it( $where ) {
			global $wpdb;
			$where .= &quot;AND $wpdb-&gt;postmeta.meta_key = &#039;start_date&#039; &quot;;
 
		  return $where;
		}
	}
}

It displays the events correctly according to the custom date key, but it still displays posts older than the current date. 

Any insight would be appreciated. I just can&#039;t seem to figure it out!</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>I&#8217;ve been trying to accomplish the same effect on my website&#8217;s events section, but I can&#8217;t seem to get the code working right. I have very minimal coding knowledge but from what it looks like, the date format is pulled from this php function date(&#8216;Y-m-d&#8217;) and compared against the flutter date format? You mentioned that the flutter format should be set to 4/20/08, but wouldn&#8217;t that be written as (&#8216;n/j/y&#8217;) ?</p>
<p>Either way I can&#8217;t seem to get it to display properly on my site. Currently I have been using some extra code in my functions.php file to keep the dates in the events category listed in order according to the flutter custom date key, I thought that perhaps this is overriding the above code?</p>
<p>This is what I&#8217;m using in the functions file.</p>
<p>add_action(&#8216;wp&#8217;, &#8216;check_category&#8217;);<br />
function check_category () {<br />
	if (in_category(&#8217;1&#8242;)) {<br />
		add_filter(&#8216;get_previous_post_sort&#8217;, &#8216;sort_it&#8217;);<br />
		add_filter(&#8216;get_next_post_sort&#8217;, &#8216;sort_it&#8217;);<br />
		add_filter(&#8216;posts_orderby&#8217;, &#8216;sort_it&#8217; );<br />
		add_filter(&#8216;posts_join&#8217;, &#8216;join_it&#8217; );<br />
		add_filter(&#8216;posts_where&#8217;, &#8216;where_it&#8217; );</p>
<p>		function sort_it () {<br />
			global $wpdb;</p>
<p>			return &#8221; $wpdb-&gt;postmeta.meta_value ASC &#8220;;<br />
		}</p>
<p>		function join_it( $join ) {<br />
			global $wpdb;</p>
<p>			$join .= &#8221; LEFT JOIN $wpdb-&gt;postmeta ON($wpdb-&gt;posts.ID = $wpdb-&gt;postmeta.post_id) &#8220;;</p>
<p>		  return $join;<br />
		}</p>
<p>		function where_it( $where ) {<br />
			global $wpdb;<br />
			$where .= &#8220;AND $wpdb-&gt;postmeta.meta_key = &#8216;start_date&#8217; &#8220;;</p>
<p>		  return $where;<br />
		}<br />
	}<br />
}</p>
<p>It displays the events correctly according to the custom date key, but it still displays posts older than the current date. </p>
<p>Any insight would be appreciated. I just can&#8217;t seem to figure it out!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
