<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.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>Gravity Support Forums Topic: schedules for a form to only be available on certain hours</title>
		<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours</link>
		<description>Gravity Support Forums Topic: schedules for a form to only be available on certain hours</description>
		<language>en-US</language>
		<pubDate>Tue, 07 Apr 2026 13:28:20 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/schedules-for-a-form-to-only-be-available-on-certain-hours" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31427</link>
			<pubDate>Tue, 02 Aug 2011 11:39:53 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31427@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Great.  Glad you got that to work.  Please post if you need any more assistance.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>juanlublanco on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31420</link>
			<pubDate>Tue, 02 Aug 2011 11:04:36 +0000</pubDate>
			<dc:creator>juanlublanco</dc:creator>
			<guid isPermaLink="false">31420@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks a lot! that works fine!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31414</link>
			<pubDate>Tue, 02 Aug 2011 10:22:26 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31414@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for the clarification.  So, you want to hide a widget, which contains your form, based on the time of day?  That's much easier to accomplish: all you need in that case is the Widget Logic plugin:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://wordpress.org/extend/plugins/widget-logic/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/extend/plugins/widget-logic/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Then in your widget settings there will be a box beneath the widget content which says &#34;Widget logic&#34; and a text box.  In the text box, enter this conditional:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;((date(&#38;#39;G&#38;#39;) &#38;gt; 7 &#38;amp;&#38;amp; date(&#38;#39;G&#38;#39;) &#38;lt; 22))&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That's it.  This will honor the timezone setting in your WordPress admin, unlike the previous code example which relied on server time.&#60;/p&#62;
&#60;p&#62;Let me know how that works out for you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>juanlublanco on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31396</link>
			<pubDate>Tue, 02 Aug 2011 06:17:58 +0000</pubDate>
			<dc:creator>juanlublanco</dc:creator>
			<guid isPermaLink="false">31396@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;[this is a literal translation of google, sorry]&#60;/p&#62;
&#60;p&#62;I have not tried the options mentioned as these are options for the body of the post.&#60;br /&#62;
Today I want to show or hide based on the time a widget located in the sidebar with a short form, perhaps there is a plugin to hide or show widgets based on the hour.&#60;/p&#62;
&#60;p&#62;I have taken so long to comment because the reports I have come in the mail.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31199</link>
			<pubDate>Fri, 29 Jul 2011 12:04:41 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31199@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Working on it some more: would it be acceptable to just hide the form with CSS (display:none;)?  That will prevent normal, casual visitors from seeing it and being able to submit it.  It would still be in the source of the page.  If that's OK, I accomplished that with some CSS and a little bit of code added to functions.php.&#60;/p&#62;
&#60;p&#62;Here's the CSS to add to the bottom of your stylesheet.  Be sure to change the form ID (mine is 7 here) to your form ID:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;body.noshowform #gform_wrapper_7 {
	display:none;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The bodyclass of &#60;strong&#62;noshowform&#60;/strong&#62; will be added to your page, based on the time of day, by adding this to your theme's functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function noform_body_class($classes = &#38;#39;&#38;#39;) {
        $h = date(&#38;#39;G&#38;#39;);
        if ($h &#38;gt; 7 &#38;amp;&#38;amp; $h &#38;lt; 22) {
                $classes[] = &#38;#39;showform&#38;#39;;
                return $classes;
        }
        else {
                $classes[] = &#38;#39;noshowform&#38;#39;;
                return $classes;
        }
}
add_filter(&#38;#39;body_class&#38;#39;,&#38;#39;noform_body_class&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;There is a commented version at pastie.org as well.&#60;br /&#62;
&#60;a href=&#34;http://pastie.org/2290467&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2290467&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;That will add a body class of showform when the hours are greater than 7 and less than 22 (so, the hour must be a minimum of 8 and not greater than or equal to 22, which will show the form up until 21:59:59.9999999).  The next line, &#60;strong&#62; $classes[] = 'showform';&#60;/strong&#62; can be commented out once you've tested and verified that the body class is being added to your source properly based on the time of day on the server.&#60;/p&#62;
&#60;p&#62;If that condition is &#60;strong&#62;not&#60;/strong&#62; met, a body class of &#34;noshowform&#34; is added to the page, and then the CSS takes over and hides the form with CSS.&#60;/p&#62;
&#60;p&#62;Let me know if you need help implementing that or are looking for a different type of solution. Thanks.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31194</link>
			<pubDate>Fri, 29 Jul 2011 10:33:37 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">31194@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is not built in to Gravity Forms but you can wrap the form shortcode in a plugin or function that hides content based on the time of day.  That will hide the form for the hours you don't want it displayed.&#60;/p&#62;
&#60;p&#62;Here's one:&#60;br /&#62;
&#60;a href=&#34;http://wordpress.org/extend/plugins/wpsleep/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/extend/plugins/wpsleep/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;UPDATE: this did not work with a form shortcode nested inside.  Looking for an alternative...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>juanlublanco on "schedules for a form to only be available on certain hours"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/schedules-for-a-form-to-only-be-available-on-certain-hours#post-31187</link>
			<pubDate>Fri, 29 Jul 2011 06:59:44 +0000</pubDate>
			<dc:creator>juanlublanco</dc:creator>
			<guid isPermaLink="false">31187@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is it possible to add in schedules for a form to only be available on certain hours? for example only from 8 a.m. to 22 p.m.??
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
