<?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: Shortcode &#38; WP_Query does not load gravityforms.js</title>
		<link>https://legacy.forums.gravityhelp.com/topic/shortcode-wp_query-does-not-load-gravityformsjs</link>
		<description>Gravity Support Forums Topic: Shortcode &amp; WP_Query does not load gravityforms.js</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 19:51:46 +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/shortcode-wp_query-does-not-load-gravityformsjs" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Shortcode &#38; WP_Query does not load gravityforms.js"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/shortcode-wp_query-does-not-load-gravityformsjs#post-65780</link>
			<pubDate>Wed, 11 Jul 2012 11:40:30 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">65780@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Moved to feature requests
&#60;/p&#62;</description>
		</item>
		<item>
			<title>refreshboy on "Shortcode &#38; WP_Query does not load gravityforms.js"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/shortcode-wp_query-does-not-load-gravityformsjs#post-65775</link>
			<pubDate>Wed, 11 Jul 2012 11:30:54 +0000</pubDate>
			<dc:creator>refreshboy</dc:creator>
			<guid isPermaLink="false">65775@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;We have a page in which we display posts using WP_Query, one of those posts has the following shortcode:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
[gravityform id=&#34;1&#34; name=&#34;Something&#34; title=&#34;false&#34; description=&#34;false&#34; ajax=&#34;true&#34;]
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;This worked until we added conditional logic, at which point display:none was added.&#60;br /&#62;
Viewing the post on its own (in which the post was displayed using &#34;the loop&#34; instead of WP_Query), the form suddenly worked again.&#60;/p&#62;
&#60;p&#62;After comparing the differences, we saw gravityforms.js was not loading.&#60;br /&#62;
Adding the following code to header.php solved the issue:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
wp_register_script(&#34;gforms_gravityforms&#34;, GFCommon::get_base_url() . &#34;/js/gravityforms.js&#34;, null, GFCommon::$version);&#60;br /&#62;
wp_enqueue_script( 'gforms_gravityforms' );
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;My suggestion to fix this is:&#60;br /&#62;
+ Always register all the scripts using wp_register_script (right now it only registers the script when there is an actual form, which kind of defeats the purpose of register &#38;amp; enqueue script)&#60;br /&#62;
+ Document the need for wp_enqueue_script( 'gforms_gravityforms' ); in a special case like this. For example in the &#60;a href=&#34;http://www.gravityhelp.com/question/why-is-there-a-style-attribute-of-displaynone-being-added-my-form-isnt-showing-up/&#34; rel=&#34;nofollow&#34;&#62;faq&#60;/a&#62;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
