<?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: Post to category being viewed dynamically...</title>
		<link>https://legacy.forums.gravityhelp.com/topic/post-to-category-being-viewed-dynamically</link>
		<description>Gravity Support Forums Topic: Post to category being viewed dynamically...</description>
		<language>en-US</language>
		<pubDate>Sat, 11 Apr 2026 22:58:02 +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/post-to-category-being-viewed-dynamically" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Post to category being viewed dynamically..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-to-category-being-viewed-dynamically#post-42381</link>
			<pubDate>Mon, 28 Nov 2011 20:19:52 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">42381@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Sallana,&#60;/p&#62;
&#60;p&#62;I'd recommend the hidden field approach which you would dynamically populate with the current category ID. Using the gform_after_submission hook you could retrieve the value populated in the hidden field (category ID) and then use the &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/wp_set_object_terms&#34; rel=&#34;nofollow&#34;&#62;wp_set_object_terms&#60;/a&#62; function.&#60;/p&#62;
&#60;p&#62;Here is a related thread that might have some more information for you:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/add-parent-post-category-with-hookfilter&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/add-parent-post-category-with-hookfilter&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Sallana on "Post to category being viewed dynamically..."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-to-category-being-viewed-dynamically#post-41049</link>
			<pubDate>Mon, 14 Nov 2011 16:25:36 +0000</pubDate>
			<dc:creator>Sallana</dc:creator>
			<guid isPermaLink="false">41049@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Setting up a WP site that has a similar structure to craigslist.. There are many regions and each region is a category. I've put a form for submitting a listing in my category.php file. I need the form to post to the category that is being viewed. How would I achieve this?&#60;/p&#62;
&#60;p&#62;What I have tried so far... :&#60;br /&#62;
Viewing and using the source code. I found that there was a piece of code that looked liked this:&#60;br /&#62;
action='/?cat=3#gf_1'&#38;gt;&#60;br /&#62;
.. And I thought, oh that's where it tells it to post to the specific category... So I change it to:&#60;br /&#62;
action='/?cat=&#38;lt;?php the_category_ID(); ?&#38;gt;#gf_1'&#38;gt;&#60;/p&#62;
&#60;p&#62;Which seemed to work but it would still post to category 3. I think that line just showed what category page you were in by default.&#60;/p&#62;
&#60;p&#62;I've searched through the documentation and forum, and of course have considered adding a hidden category field that is pre-populated, but not sure if that would work. As I understand it, you have to place the following in your functions.php file.. : &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_your_parameter&#38;#39;, &#38;#39;my_custom_population_function&#38;#39;)
function my_custom_population_function($value){
    return &#38;#39;boom!&#38;#39;;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The return value would have to be something like the_category_id but I'm not sure how to merge those two things together. And even if I could, I'm not sure that it would work. And also it appears that you *have* to set a category for the form to post to in the post title. So how would I stop it from posting to more than one category and only posting to the category which the user is currently viewing? &#60;/p&#62;
&#60;p&#62;Thanks in advance.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
