<?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: Adding a Views and Types template when using Gravity Forms to submit a post</title>
		<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post</link>
		<description>Gravity Support Forums Topic: Adding a Views and Types template when using Gravity Forms to submit a post</description>
		<language>en-US</language>
		<pubDate>Sun, 05 Apr 2026 11:43:04 +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/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post" rel="self" type="application/rss+xml" />

		<item>
			<title>theslink2000 on "Adding a Views and Types template when using Gravity Forms to submit a post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post#post-70655</link>
			<pubDate>Sat, 11 Aug 2012 04:36:31 +0000</pubDate>
			<dc:creator>theslink2000</dc:creator>
			<guid isPermaLink="false">70655@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi ckrauskopf,&#60;/p&#62;
&#60;p&#62;I never thought about doing it that way, it's really interesting and as you said it gives you a degree of flexibility my solution doesn't.  I think it's fair to say your solution is great if you need that extra level of control, such as you suggest, submitting multiple custom post types, and mine is good for just a simple form.&#60;/p&#62;
&#60;p&#62;Oh I forgot to post to add action for my solution.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;add_action(&#38;quot;gform_after_submission_7&#38;quot;, &#38;quot;set_view_template&#38;quot;, 10, 2);  // Set&#38;#39;s the View Template&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;On an unrelated note, you've just  given me an idea of how to fix my next issue, using GForms as an edit function!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ckrauskopf on "Adding a Views and Types template when using Gravity Forms to submit a post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post#post-70616</link>
			<pubDate>Fri, 10 Aug 2012 17:10:49 +0000</pubDate>
			<dc:creator>ckrauskopf</dc:creator>
			<guid isPermaLink="false">70616@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I forgot to post here after encountering this myself.  As others have found, setting the view template in the normal way apparently doesn't work, but my solution was a bit different.  &#60;/p&#62;
&#60;p&#62;Rather than setting the _views_template when creating or updating the post, I'm setting it with a filter when displaying a particular post type.  So my code doesn't actually affect Gravity Forms at all.  It seems like this has a few advantages for my particular situation.  It doesn't matter which form created the post (in case you want to have totally different forms that create the same post type, this code will apply to all of them), and you can create a form that creates posts of multiple different post types on one form submission ( in that case you just need to have one instance of this filter for each post type).&#60;/p&#62;
&#60;p&#62;Disclaimer:  I'm not a php expert, so maybe I don't grasp all the nuances and implications of the different approaches.   There may be advantages to the other approach or disadvantages to mine that I haven't noticed.  I arrived at my approach by working through the Types and Views forums and my excerpt works like a charm on my site.  &#60;/p&#62;
&#60;p&#62;Thanks for posting theslink2000 - it's nice to see another approach.&#60;/p&#62;
&#60;p&#62;Here's my code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//Set Views Template Custom Post Type Created by GF on the Front End
add_filter(&#38;#39;get_post_metadata&#38;#39;, &#38;#39;meter_template_filter&#38;#39;, 1, 4);
function meter_template_filter($dummy, $post_id, $meta_key, $single) {
if ($meta_key == &#38;#39;_views_template&#38;#39;) {
if (is_singular(&#38;#39;your-custom-post-type-slug&#38;#39;)) {
return 267; //replace 267 with the id of your views template
}
}
return null;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>theslink2000 on "Adding a Views and Types template when using Gravity Forms to submit a post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post#post-70563</link>
			<pubDate>Fri, 10 Aug 2012 11:03:25 +0000</pubDate>
			<dc:creator>theslink2000</dc:creator>
			<guid isPermaLink="false">70563@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Not sure if you're still working at this or not but I've been working on a large project with these three plugins as well and hit the View Template issue this morning but I've solved it.&#60;/p&#62;
&#60;p&#62;Basically even if the settings are set to correctly create the new post type with the template it wasn't working for me when the post was created by GForms.  So I got to this code &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Manually set the View Template for the Surgeries Post Type
function set_view_template($entry) {
	update_post_meta($entry[&#38;#39;post_id&#38;#39;], &#38;quot;_views_template&#38;quot;, 257);  //Update post meta, current post, _views_template is the database field and 257 is the required View Template
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;All you need to do is change 257 to the View Template id (visible in the url when you edit it).  I also used a similar trick to handle post relationships.&#60;/p&#62;
&#60;p&#62;Hope it helps!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ckrauskopf on "Adding a Views and Types template when using Gravity Forms to submit a post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post#post-63981</link>
			<pubDate>Thu, 28 Jun 2012 18:02:21 +0000</pubDate>
			<dc:creator>ckrauskopf</dc:creator>
			<guid isPermaLink="false">63981@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'll just note that I am attempting a rather complicated site where Gravity Forms is used to populated dozens of custom fields and create several different custom post types on form submission.  All of these Post types and fields will be controlled by the Types and Views plugins.  So if I learn any tricks about integrating the 2 with GForms I'll try to post later.  It seems as though Types and Views are also very good plugins (as of course GForms is too).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ckrauskopf on "Adding a Views and Types template when using Gravity Forms to submit a post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post#post-63977</link>
			<pubDate>Thu, 28 Jun 2012 17:58:06 +0000</pubDate>
			<dc:creator>ckrauskopf</dc:creator>
			<guid isPermaLink="false">63977@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am using types and views for a couple of sites too, and I'm just learning myself, but it seems like your use case should be covered by the feature where you can assign a view template to the single version of a custom post type.  It's under Views --&#38;gt;  Settings - detailed documentation here:&#60;br /&#62;
&#60;a href=&#34;http://wp-types.com/documentation/user-guides/setting-view-templates-for-single-pages/&#34; rel=&#34;nofollow&#34;&#62;http://wp-types.com/documentation/user-guides/setting-view-templates-for-single-pages/&#60;/a&#62;.  &#60;/p&#62;
&#60;p&#62;If that doesn't work for some reason, you could back your way into it.  Wordpress will look for an archive template named &#34;single-{posttype}.php&#34;.  In the Views plugin UI when you create a view-template you can toggle a button to see all the html being output by the plugin, so you could just use that html from the view-template you created to form the basis of your template in single-advertisement.php and Wordpress should automatically apply it to any new advertisements.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Lee Branch on "Adding a Views and Types template when using Gravity Forms to submit a post"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-a-views-and-types-template-when-using-gravity-forms-to-submit-a-post#post-59527</link>
			<pubDate>Sun, 20 May 2012 04:08:30 +0000</pubDate>
			<dc:creator>Lee Branch</dc:creator>
			<guid isPermaLink="false">59527@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for such a great plugin, love it!&#60;/p&#62;
&#60;p&#62;I also love Views and Types (&#60;a href=&#34;http://wp-types.com/&#34; rel=&#34;nofollow&#34;&#62;http://wp-types.com/&#60;/a&#62;)&#60;/p&#62;
&#60;p&#62;I am using Gravity Forms to let advertisers create a custom post type (advertisement) on my site.  I have set up a view template with views and types to control how these individual posts are displayed.&#60;/p&#62;
&#60;p&#62;Can anyone suggest a way of setting the custom post type submitted through a gravity form to automatically use this template created with views and types?&#60;/p&#62;
&#60;p&#62;My current thinking is that this isn't possible, so I'm planning to set all submitted posts to pending, then manually assigning the template myself via the admin dashboard before publishing.  Obviously this is not ideal as it could be tens or hundreds of posts a day.&#60;/p&#62;
&#60;p&#62;Thanks for your help,&#60;br /&#62;
Lee
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
