<?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: wp_head include</title>
		<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include</link>
		<description>Gravity Support Forums Topic: wp_head include</description>
		<language>en-US</language>
		<pubDate>Thu, 16 Apr 2026 17:47:35 +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/wp_head-include" rel="self" type="application/rss+xml" />

		<item>
			<title>d4le on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1602</link>
			<pubDate>Wed, 18 Nov 2009 16:59:38 +0000</pubDate>
			<dc:creator>d4le</dc:creator>
			<guid isPermaLink="false">1602@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've done it with the_content hook as I posted above, it seems like the gf enqueue functions should work, because it's getting called before the wp_head(), (I assume). But it doesn't!&#60;/p&#62;
&#60;p&#62;I wonder if the problem is in the wp hook, or if it's something you could check for in your program.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>d4le on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1601</link>
			<pubDate>Wed, 18 Nov 2009 16:55:49 +0000</pubDate>
			<dc:creator>d4le</dc:creator>
			<guid isPermaLink="false">1601@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;One more thing, making this a must-have if you want to output a form in a wordpress hook,&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter (&#38;#39;the_content&#38;#39;, &#38;#39;insertForm&#38;#39;);
function insertForm($content) {
        if(is_single()) {
                $content.= get_gravity_form(1,false,false);
        }
        return $content;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You can see how the hook can get even more specific.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1553</link>
			<pubDate>Tue, 17 Nov 2009 18:20:27 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">1553@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;d4le,&#60;br /&#62;
Thanks for reply. You are absolutely right. If you call the function too late in the life-cycle, the proper scripts won't be printed properly.&#60;/p&#62;
&#60;p&#62;Your solution is certainly a good one. I will talk to the rest of the team and see how we want to tackle it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>d4le on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1547</link>
			<pubDate>Tue, 17 Nov 2009 14:38:45 +0000</pubDate>
			<dc:creator>d4le</dc:creator>
			<guid isPermaLink="false">1547@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That was easy, I just did it in five minutes:&#60;/p&#62;
&#60;p&#62;add this function to the gravityforms.php (hacking the core, I know):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function get_gravity_form($id, $display_title=true, $display_description=true, $display_inactive=false, $field_values=null){
    return RGForms::get_form($id, $display_title, $display_description, $display_inactive, $field_values);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Then in your template before an instantiation of a wp query object (ie the loop), &#60;/p&#62;
&#60;p&#62;&#60;code&#62;$my_form = get_gravity_form(1,false,false);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Then in or after the loop (or whatever query object), add an&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;?php echo $my_form ?&#38;gt;&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>d4le on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1546</link>
			<pubDate>Tue, 17 Nov 2009 14:14:21 +0000</pubDate>
			<dc:creator>d4le</dc:creator>
			<guid isPermaLink="false">1546@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex, &#60;/p&#62;
&#60;p&#62;Since you're using conditionals to check for the presence of the form inside your plugin, and only then using the enqueue functions, the template tag has to happen BEFORE the instantiation of the wordpress query object for the enqueue to work.  So if your template tag is in the loop or after 'the content', it ain't gonna happen.&#60;/p&#62;
&#60;p&#62;Solution, create a template tag that returns the html of a form as an html escaped string, but doesn't echo it like the current one does.&#60;/p&#62;
&#60;p&#62;Before the loop, add $my_form = get_gravity_form(1,false,false);&#60;/p&#62;
&#60;p&#62;after the loop, echo $my_form; the scripts/css will be output.&#60;/p&#62;
&#60;p&#62;I've confirmed that putting gravity_form(1,false,false) before the loop will output the script, after the loop, no (aforementioned reasons).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1537</link>
			<pubDate>Tue, 17 Nov 2009 09:22:35 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">1537@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Mark,&#60;br /&#62;
I will take a look into this. The scripts and css are supposed to be included if you use the template tags.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>d4le on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1536</link>
			<pubDate>Tue, 17 Nov 2009 08:37:06 +0000</pubDate>
			<dc:creator>d4le</dc:creator>
			<guid isPermaLink="false">1536@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I added this to the functions.php file in my template..&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if(function_exists(&#38;#39;gravity_form&#38;#39;)){
      add_action(&#38;#39;wp_print_styles&#38;#39;, &#38;#39;gforms_style&#38;#39;);
      function gforms_style(){ wp_enqueue_style(&#38;quot;gforms_css&#38;quot;, GFCommon::get_base_url() . &#38;quot;/css/forms.css&#38;quot;); }
    }&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>markbloomfield on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1534</link>
			<pubDate>Tue, 17 Nov 2009 06:11:41 +0000</pubDate>
			<dc:creator>markbloomfield</dc:creator>
			<guid isPermaLink="false">1534@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;*bump :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>markbloomfield on "wp_head include"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_head-include#post-1288</link>
			<pubDate>Mon, 02 Nov 2009 01:44:35 +0000</pubDate>
			<dc:creator>markbloomfield</dc:creator>
			<guid isPermaLink="false">1288@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Heya guys&#60;/p&#62;
&#60;p&#62;When inserting the form via a template tag (or any other method other than directly into a page), the JS and CSS for GForms isn't included in the head.&#60;/p&#62;
&#60;p&#62;Could you perhaps include a method of a) option to always include gforms stuff in the head, or b) detect usage of the template tag &#38;amp; include head stuff...&#60;/p&#62;
&#60;p&#62;Either way...&#60;br /&#62;
Thanks :)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
