<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>ThemeShaper Forums Topic: set expiration date/time for posts</title>
<link>http://themeshaper.com/forums/</link>
<description>Help In Shaping WordPress Themes</description>
<language>en</language>
<pubDate>Wed, 22 May 2013 12:15:08 +0000</pubDate>

<item>
<title>candregg on "set expiration date/time for posts"</title>
<link>http://themeshaper.com/forums/topic/set-expiration-datetime-for-posts#post-14928</link>
<pubDate>Mon, 23 Aug 2010 14:46:42 +0000</pubDate>
<dc:creator>candregg</dc:creator>
<guid isPermaLink="false">14928@http://themeshaper.com/forums/</guid>
<description>&#60;p&#62;I am trying to adjust the category loop in a Thematic child theme to set an expiration date for -time-sensitive posts.&#60;/p&#62;
&#60;p&#62;Here's the function I cobbled together so far:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
//  Set post Expiration Time  ( for appearances) &#60;/p&#62;
&#60;p&#62;function remove_categoryloop() {&#60;br /&#62;
    remove_action('thematic_categoryloop', 'thematic_category_loop');&#60;br /&#62;
}&#60;br /&#62;
add_action('init', 'remove_categoryloop');&#60;/p&#62;
&#60;p&#62;function my_categoryloop() {&#60;br /&#62;
while (have_posts()) : the_post();&#60;br /&#62;
	  $expirationtime = get_post_custom_values('expiration');&#60;br /&#62;
         if (is_array($expirationtime)) {&#60;br /&#62;
             $expirestring = implode($expirationtime);&#60;br /&#62;
         }&#60;/p&#62;
&#60;p&#62;         $secondsbetween = strtotime($expirestring)-time();&#60;br /&#62;
         if ( $secondsbetween &#38;gt; 0 ) {&#60;br /&#62;
             // For exemple...&#60;br /&#62;
             the_title();&#60;br /&#62;
             the_excerpt();&#60;br /&#62;
         }&#60;/p&#62;
&#60;p&#62;        ?&#38;gt;&#38;lt;div id=&#34;post-&#38;lt;?php the_ID(); ?&#38;gt;&#34; class=&#34;&#38;lt;?php thematic_post_class(); ?&#38;gt;&#34;&#38;gt;&#60;br /&#62;
              &#38;lt;?php thematic_postheader(); ?&#38;gt;&#60;br /&#62;
              &#38;lt;div class=&#34;entry-content&#34;&#38;gt;&#60;br /&#62;
&#38;lt;?php thematic_content(); ?&#38;gt;&#60;/p&#62;
&#60;p&#62;&#38;lt;/div&#38;gt;&#60;br /&#62;
              &#38;lt;?php thematic_postfooter(); ?&#38;gt;&#60;br /&#62;
          &#38;lt;/div&#38;gt;&#38;lt;!-- .post --&#38;gt;&#60;/p&#62;
&#60;p&#62;      &#38;lt;?php endwhile;&#60;br /&#62;
}&#60;br /&#62;
add_action('thematic_categoryloop', 'my_categoryloop');&#60;/p&#62;
&#60;p&#62;&#60;/code&#62;&#60;br /&#62;
I added a custom filed called 'expiration' to the post, and gave it an expire date/time of '08/19/2010 20:00:00'.  &#60;/p&#62;
&#60;p&#62;So far, it's not working, but at least it hasn't broken anything yet.  My php is lame, at best, so any help would be appreciated.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
