I have pored over previous posts on this but I get a bit lost with the hooks and query strings etc... I tried:
query_posts( 'post_type=listing' );
But it did not do anything. Any hints or outright instructions would be most welcome.
Thanks
I have pored over previous posts on this but I get a bit lost with the hooks and query strings etc... I tried:
query_posts( 'post_type=listing' );
But it did not do anything. Any hints or outright instructions would be most welcome.
Thanks
I have forwarded this forum post to one of our developers who will drop in with some information on how to use the hooks to do this. It may not be until sometime on Monday before they respond.
Hi Ekajatik,
Paste this snippet in your functions.php file: http://pastie.org/1617402
Make sure to update the variables as specified in the inline comments.
I think this is exactly what i need. Sorry for being a noobie but were do i get the "ID of your drop down field" and what do i need to put " $post_type = 'review'; // update"?
Is it possible to use this approach to ask customer to chooses a product category and then populate the next dropdown menu with products from that category?
Thanks
Hi Norppa,
You can retrieve your field ID by viewing the source of your form and finding the ID of the field in question. It will look something like this "input_20_4". In this example, the 20 would be the form ID and the 4 would be the field ID.
As for the $post_type. You'll want to set this to the singular name of your desired post type. In my example I used reviews. You can replace this with any post type. Even standard WordPress post types such as "post" or "page".
It is possible to populate one drop down with values based on the option selected in another drop down; however, to do this on the fly would require ajax and some additional coding. You can alternately use GF's built in conditional logic to make a series of hidden drop downs that only display the correct drop down based on your primary drop down selection.
Thanks for a quick reply. I found another thread on the forum and used the snippet from there to populate post-titles. Then i used your suggestion to use GF's built in conditional logic to hide the dropdowns. Works lika a charm, thanks guys for a great product.
One question thou, is it possible to list entries on a page. What i mean is, a logged in user would have a page where he/she could see a list of entries they made.
Thanks
@norppa Gravity Forms doesn't currently list entries on the front end. But there is a plugin called the Gravity Forms Directory Add-On that is a 3rd party plugin that does do this if you wanted to try it. We didn't create it, but a lot of users are using it.
Sure, you can write custom code to list entries on the front end. Thats entirely up to you. The data is all stored in your database so it's certainly possible for you to write custom code to display it however you want.
Im using the code posted above ( http://pastie.org/1617402 ) to populate a select dropdown. But for some reason only the first 5 posts get populated. There is more than 5 posts of the specific post_type. Anyone know why this is happening?