I would like to display a "Post to this Category" form on the main category pages. I would also like the category field dynamically populated with the current category being viewed.
Please let me know if more information is required.
Regards Jeroen.
I would like to display a "Post to this Category" form on the main category pages. I would also like the category field dynamically populated with the current category being viewed.
Please let me know if more information is required.
Regards Jeroen.
To add it to the category archive, you will have to add the form to the template file using the function call. You can read more about that here.
When you do that, you can use WordPress functions to get the category and populate the category field dynamically. Do you use specific templates for each category, or one archive.php or other file for all your categories?
Thanks Chris,
Your link was broken.
I just have 1 category template on my "Swift Theme"
I fixed the link. Sorry about that. Can you take a look at that and let me know if you have any questions? Thanks
Thanks Chris, I found the link and have used the function call to retrieve the form and insert it into category page.
I have found many pieces of code that should actually do what i want but they don't seem to work. We will continue, however if you can provide some assistance it would be much appreciated.
Please share some of the code you're using, template files, your theme's functions.php, etc. Use pastie.org or pastebin.com if the code examples are lengthy. We won't be able to help you without seeing the code you're using. Thank you.
Hi Chris, I am still somewhat of a novice I feel and I do appreciate your help. I have added the index.php (which loads all my categories) to a pastie here http://pastie.org/3143768 Line 90 is where I call the form. You can view the form on any of my category pages. here is 1 example http://freeineurope.com/category/free-tourist-attractions-in-netherlands-holland/
The Post Category field currently displays a drop down box with the option to select any of the categories in my blog. However in the case of the Holland Category linked above I want this field to be pre-populated with the "Holland" Category.
I found the below code on this forum ( http://www.gravityhelp.com/forums/topic/dynamically-populate-field-using-variable ) without success
add_filter("gform_field_value_categoryid", "populate_categoryid");
function populate_categoryid($value){
return get_query_var('cat');
}
Please advise if you need more information.
Thanks for your help Chris, but I have figured it out. I was close, the above code works perfectly I just wasn't calling the correct parameter name. All I had to do was change "gform_field_value_categoryid" to "gform_field_value_category" as that was the name I had given the parameter. :)