<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<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">
	<channel>
		<title>THE MOLITOR FORUMS &#187; Topic: FAQ - Remove expired posts from the slider</title>
		<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider</link>
		<description>THE MOLITOR FORUMS &#187; Topic: FAQ - Remove expired posts from the slider</description>
		<language>en-US</language>
		<pubDate>Tue, 28 Apr 2026 06:46:28 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.themolitor.com/forums/search.php</link>
		</textInput>
		<atom:link href="http://www.themolitor.com/forums/rss/topic/faq-remove-expired-posts-from-the-slider" rel="self" type="application/rss+xml" />

		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-33041</link>
			<pubDate>Thu, 12 Feb 2015 10:15:58 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">33041@http://www.themolitor.com/forums/</guid>
			<description><p>Awesome! Thanks for following up.</p>
<p>I hope you're enjoying the theme :-)</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>PearceRules on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-33027</link>
			<pubDate>Wed, 11 Feb 2015 23:01:00 +0000</pubDate>
			<dc:creator>PearceRules</dc:creator>
			<guid isPermaLink="false">33027@http://www.themolitor.com/forums/</guid>
			<description><p>After digging some posts, I was able to piece stuff together. Here's the working code I got going..</p>
<p>slider.php:</p>
<pre><code>&#60;?php
//VAR SETUP
$sliderCat = get_option(&#039;themolitor_slider_category&#039;);
$sliderNumber = get_theme_mod(&#039;themolitor_customizer_slider_number&#039;);
?&#62;

&#60;!--SLIDER--&#62;
&#60;div id=&#34;slider&#34;&#62;
        &#60;ul class=&#34;slides&#34;&#62;
                &#60;?php
add_filter( &#039;posts_where&#039;, &#039;filter_where&#039; );
$showPostsInCategory = new WP_Query();
$showPostsInCategory-&#62;query(&#039;order=asc&#38;cat=&#039;.$sliderCat.&#039;&#38;showposts=&#039;.$sliderNumber) .&#039;&#38;date&#62;=&#34;&#039;.$now.&#039;&#34;&#039;;  ?&#62;
		&#60;?php if ($showPostsInCategory-&#62;have_posts()) :?&#62;
		&#60;?php while ($showPostsInCategory-&#62;have_posts()) : $showPostsInCategory-&#62;the_post(); ?&#62;

&#60;li&#62;
			&#60;div class=&#34;sliderInfo&#34;&#62;
				&#60;a&#62;&#34;&#62;&#60;?php the_title();?&#62;&#60;/a&#62;
				&#60;div class=&#34;sliderDate&#34;&#62;&#60;?php echo get_the_time(&#039;m.d.Y&#039;); ?&#62;&#60;/div&#62;
			&#60;/div&#62;
			&#60;?php the_post_thumbnail(&#039;slider&#039;); ?&#62;

&#60;?php endwhile; endif; remove_filter( &#039;posts_where&#039;, &#039;filter_where&#039; );?&#62;

&#60;/div&#62;</code></pre>
<p>Then, to functions.php at the very end, I added:</p>
<pre><code>// Create a new filtering function that will add our where clause to the query
function filter_where( $where = &#039;&#039; ) {
        // show only post in future
       	$now = date(&#34;Y-m-d&#34;);
        $where .= &#34; AND post_date&#62;=&#039;$now&#039;&#34;;
        return $where;
}&#60;/li&#62;</code></pre></description>
		</item>
		<item>
			<title>PearceRules on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-33026</link>
			<pubDate>Wed, 11 Feb 2015 22:34:40 +0000</pubDate>
			<dc:creator>PearceRules</dc:creator>
			<guid isPermaLink="false">33026@http://www.themolitor.com/forums/</guid>
			<description><p>Then, I need those events to expire and be removed from the slider by around midnightish-8am
</p></description>
		</item>
		<item>
			<title>PearceRules on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-33025</link>
			<pubDate>Wed, 11 Feb 2015 21:23:42 +0000</pubDate>
			<dc:creator>PearceRules</dc:creator>
			<guid isPermaLink="false">33025@http://www.themolitor.com/forums/</guid>
			<description><p>Hey, I used the code from the above post and I can only get the very first code to work (that was posted in this thread). I need to display the next coming up 10 events. Not the most in the future events.</p>
<p><a href="http://www.bearsdenpizza.net" rel="nofollow">http://www.bearsdenpizza.net</a>
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-32994</link>
			<pubDate>Tue, 10 Feb 2015 10:40:36 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">32994@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>I did a test and can confirm the event doesn't expire until the next day. It sounds like you may have an issue with your timezone settings on your hosting perhaps. </p>
<p>What timezone are you in?</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>Twofourzulu on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-32948</link>
			<pubDate>Fri, 06 Feb 2015 16:23:20 +0000</pubDate>
			<dc:creator>Twofourzulu</dc:creator>
			<guid isPermaLink="false">32948@http://www.themolitor.com/forums/</guid>
			<description><p>That is not what is happening on our site. I watched the calendar this evening and the event was removed at the start time of the event. For example if the event post has a date and time of Feb 6 2015 @ 1800 it is removed as soon as the time has passed not the end of the day. I am attaching our slider.php code. The site is <a href="http://www.dceagle.com" rel="nofollow">http://www.dceagle.com</a></p>
<pre><code>&#60;?php
//VAR SETUP
$sliderCat = get_option(&#039;themolitor_slider_category&#039;);
$sliderNumber = get_theme_mod(&#039;themolitor_customizer_slider_number&#039;);
?&#62;

&#60;!--SLIDER--&#62;
&#60;div id=&#34;slider&#34;&#62;
	&#60;ul class=&#34;slides&#34;&#62;
		&#60;?php
		$showPostsInCategory = new WP_Query(); $showPostsInCategory-&#62;query(&#039;order=ASC&#38;cat=&#039;.$sliderCat.&#039;&#38;showposts=&#039;.$sliderNumber);
		if ($showPostsInCategory-&#62;have_posts()) :
		while ($showPostsInCategory-&#62;have_posts()) : $showPostsInCategory-&#62;the_post();
		if(strtotime(get_the_time(&#039;Y-m-d&#039;)) &#62;= strtotime(date(&#039;Y-m-d&#039;))){
		?&#62;

&#60;li&#62;
			&#60;div class=&#34;sliderInfo&#34;&#62;
				&#60;a&#62;&#34;&#62;&#60;?php the_title();?&#62;&#60;/a&#62;
				&#60;div class=&#34;sliderDate&#34;&#62;&#60;?php echo get_the_time(&#039;m.d.Y&#039;); ?&#62;&#60;/div&#62;
			&#60;/div&#62;
			&#60;?php the_post_thumbnail(&#039;slider&#039;); ?&#62;
		&#60;/li&#62;
		&#60;?php }	endwhile; endif; ?&#62;

&#60;/div&#62;</code></pre></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-32937</link>
			<pubDate>Fri, 06 Feb 2015 09:29:30 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">32937@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>The current process will expire the post the day AFTER the event took place.</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>Twofourzulu on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-32931</link>
			<pubDate>Thu, 05 Feb 2015 21:50:47 +0000</pubDate>
			<dc:creator>Twofourzulu</dc:creator>
			<guid isPermaLink="false">32931@http://www.themolitor.com/forums/</guid>
			<description><p>Chris, </p>
<p>Is there an expression that will allow the post to expire posts at the end of the day rather than at the start/publish time of the post. </p>
<p>John
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-29368</link>
			<pubDate>Tue, 20 May 2014 10:03:05 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">29368@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>The change I posted doesn't have any impact on loading times or animation speeds. Maybe try reducing the number of items in the slider to see if that has any impact.</p>
<p>Let me know.</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>greytail2009 on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-29362</link>
			<pubDate>Tue, 20 May 2014 05:40:47 +0000</pubDate>
			<dc:creator>greytail2009</dc:creator>
			<guid isPermaLink="false">29362@http://www.themolitor.com/forums/</guid>
			<description><p>I changed my slider.php to the new one posted by Chris, but my slider is behaving a bit erratically,,,,dwelling on some pics and rushing through others....I have the slider number set to 20. It's pacing was fine until I made the change...perhaps it is loading time???</p>
<p><a href="http://www.scenesofvermont.com/svevents" rel="nofollow">http://www.scenesofvermont.com/svevents</a>
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-26558</link>
			<pubDate>Tue, 21 Jan 2014 13:54:08 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">26558@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>It doesn't sound like your categories have the "All Events" category properly assigned as the parent category. Be sure each sub category for the calendar has "All Events" assigned as the parent and that "All Events" is selected as the main event category for the calendar.</p>
<p>Also, make sure your permalink structure is set to "month and name" on the permalinks page.</p>
<p>Regarding the slider, try creating a "slider" category and assign that to posts you want to display in the slider. Then assign that category as the slider category on the Customize page.</p>
<p>Let me know if that helps.</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>Twofourzulu on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-26554</link>
			<pubDate>Tue, 21 Jan 2014 12:51:30 +0000</pubDate>
			<dc:creator>Twofourzulu</dc:creator>
			<guid isPermaLink="false">26554@http://www.themolitor.com/forums/</guid>
			<description><p>Currently the slide number is set to 13 and the slide category is set to "All Events" which was the default 'Events' category, additionally all the posts on the calendar have this category checked. I did not create a category specifically for the slider. </p>
<p>If you also look at the calendar there is a "/" before the All Event category, is this related?
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-26543</link>
			<pubDate>Tue, 21 Jan 2014 10:21:15 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">26543@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>I visited the link and see 5 slides. What is the number currently set to? </p>
<p>Also, did you create a category specifically for the slider (not part of the events category)?</p>
<p>Let me know.</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>Twofourzulu on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-26526</link>
			<pubDate>Mon, 20 Jan 2014 18:13:28 +0000</pubDate>
			<dc:creator>Twofourzulu</dc:creator>
			<guid isPermaLink="false">26526@http://www.themolitor.com/forums/</guid>
			<description><p>The posts that are not showing automatically are not expired and in the future. Additionally when expired posts are removed from the slider.php due to the if/then/while rule, new dates to sill the empty slots are not being added. Right now I have the slider count set at 12 whcih only shows 7 sliders on the site. </p>
<p>I only have this issue if I use the ascending order code change that you provided under the expired event slider code update.  </p>
<p>If you are interested is seeing the effect the url is <a href="http://www.dceagle.com" rel="nofollow">http://www.dceagle.com</a>
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-26513</link>
			<pubDate>Mon, 20 Jan 2014 14:09:14 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">26513@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>Can you verify the posts aren't expired (i.e. the publish date is older than today's date)?</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>Twofourzulu on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-26507</link>
			<pubDate>Mon, 20 Jan 2014 12:55:18 +0000</pubDate>
			<dc:creator>Twofourzulu</dc:creator>
			<guid isPermaLink="false">26507@http://www.themolitor.com/forums/</guid>
			<description><p>I tried this fix and have the number of sliders set to show at 10 on the slider options tab, however only 3 events are showing on the slider. the slider.php code from the site is below:</p>
<pre><code>&#60;?php
//VAR SETUP
$sliderCat = get_option(&#039;themolitor_slider_category&#039;);
$sliderNumber = get_theme_mod(&#039;themolitor_customizer_slider_number&#039;);
?&#62;

&#60;!--SLIDER--&#62;
&#60;div id=&#34;slider&#34;&#62;
	&#60;ul class=&#34;slides&#34;&#62;
		&#60;?php
		$showPostsInCategory = new WP_Query(); $showPostsInCategory-&#62;query(&#039;order=ASC&#38;cat=&#039;.$sliderCat.&#039;&#38;showposts=&#039;.$sliderNumber);
		if ($showPostsInCategory-&#62;have_posts()) :
		while ($showPostsInCategory-&#62;have_posts()) : $showPostsInCategory-&#62;the_post();
		if(strtotime(get_the_time(&#039;Y-m-d&#039;)) &#62;= strtotime(date(&#039;Y-m-d&#039;))){
		?&#62;

&#60;li&#62;
			&#60;div class=&#34;sliderInfo&#34;&#62;
				&#60;a&#62;&#34;&#62;&#60;?php the_title();?&#62;&#60;/a&#62;
				&#60;div class=&#34;sliderDate&#34;&#62;&#60;?php echo get_the_time(&#039;m.d.Y&#039;); ?&#62;&#60;/div&#62;
			&#60;/div&#62;
			&#60;?php the_post_thumbnail(&#039;slider&#039;); ?&#62;
		&#60;/li&#62;
		&#60;?php }	endwhile; endif; ?&#62;

&#60;/div&#62;</code></pre></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-25343</link>
			<pubDate>Fri, 06 Dec 2013 13:05:41 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">25343@http://www.themolitor.com/forums/</guid>
			<description><p>You bet! :-)</p>
<p>If you're enjoying the theme, PLEASE don't forget to rate it on your downloads page on ThemeForest. Positive ratings REALLY help me out.</p>
<p>Thanks!</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>vervor44 on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-25337</link>
			<pubDate>Fri, 06 Dec 2013 11:59:12 +0000</pubDate>
			<dc:creator>vervor44</dc:creator>
			<guid isPermaLink="false">25337@http://www.themolitor.com/forums/</guid>
			<description><p>worked perfectly thanks so much - really appreciate the quick feedback
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-25333</link>
			<pubDate>Fri, 06 Dec 2013 08:53:29 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">25333@http://www.themolitor.com/forums/</guid>
			<description><p>Hi there,</p>
<p>Change the following line above from this...</p>
<pre><code>$showPostsInCategory = new WP_Query(); $showPostsInCategory-&#62;query(&#039;cat=&#039;.$sliderCat.&#039;&#38;showposts=&#039;.$sliderNumber);</code></pre>
<p>...to this...</p>
<pre><code>$showPostsInCategory = new WP_Query(); $showPostsInCategory-&#62;query(&#039;order=ASC&#38;cat=&#039;.$sliderCat.&#039;&#38;showposts=&#039;.$sliderNumber);</code></pre>
<p>Let me know if that helps.</p>
<p>Best,</p>
<p>Chris
</p></description>
		</item>
		<item>
			<title>vervor44 on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-25326</link>
			<pubDate>Fri, 06 Dec 2013 03:34:42 +0000</pubDate>
			<dc:creator>vervor44</dc:creator>
			<guid isPermaLink="false">25326@http://www.themolitor.com/forums/</guid>
			<description><p>Thanks for the above Chris. I had made the adjustment to this code you outline here (<a href="http://www.themolitor.com/forums/topic/slider-order#post-6754" rel="nofollow">http://www.themolitor.com/forums/topic/slider-order#post-6754</a>) to get the slider to show in ascending order but now that fix doesn't work with this new code... any idea how to remedy that? Thanks! Love the theme, its really well done.
</p></description>
		</item>
		<item>
			<title>THE MOLITOR on "FAQ - Remove expired posts from the slider"</title>
			<link>http://www.themolitor.com/forums/topic/faq-remove-expired-posts-from-the-slider#post-25183</link>
			<pubDate>Mon, 02 Dec 2013 11:07:11 +0000</pubDate>
			<dc:creator>THE MOLITOR</dc:creator>
			<guid isPermaLink="false">25183@http://www.themolitor.com/forums/</guid>
			<description><p>Open slider.php and replace the entire page with this...</p>
<pre><code>&#60;?php
//VAR SETUP
$sliderCat = get_option(&#039;themolitor_slider_category&#039;);
$sliderNumber = get_theme_mod(&#039;themolitor_customizer_slider_number&#039;);
?&#62;

&#60;!--SLIDER--&#62;
&#60;div id=&#34;slider&#34;&#62;
	&#60;ul class=&#34;slides&#34;&#62;
		&#60;?php
		$showPostsInCategory = new WP_Query(); $showPostsInCategory-&#62;query(&#039;cat=&#039;.$sliderCat.&#039;&#38;showposts=&#039;.$sliderNumber);
		if ($showPostsInCategory-&#62;have_posts()) :
		while ($showPostsInCategory-&#62;have_posts()) : $showPostsInCategory-&#62;the_post();
		if(strtotime(get_the_time(&#039;Y-m-d&#039;)) &#62;= strtotime(date(&#039;Y-m-d&#039;))){
		?&#62;
		&#60;li&#62;
			&#60;div class=&#34;sliderInfo&#34;&#62;
				&#60;a class=&#34;sliderTitle&#34; href=&#34;&#60;?php the_permalink();?&#62;&#34;&#62;&#60;?php the_title();?&#62;&#60;/a&#62;&#60;br /&#62;
				&#60;div class=&#34;sliderDate&#34;&#62;&#60;?php echo get_the_time(&#039;m.d.Y&#039;); ?&#62;&#60;/div&#62;
			&#60;/div&#62;
			&#60;?php the_post_thumbnail(&#039;slider&#039;); ?&#62;
		&#60;/li&#62;
		&#60;?php }	endwhile; endif; wp_reset_postdata(); ?&#62;
	&#60;/ul&#62;
&#60;/div&#62;</code></pre>
<p>The above changes will remove posts that have expired (i.e. the event/publish date is older than today's day).</p>
<p>If you find this useful, PLEASE don't forget to rate the theme on your downloads page on ThemeForest. Positive ratings REALLY help me out.</p>
<p>Thanks!</p>
<p>Chris
</p></description>
		</item>

	</channel>
</rss>
