Mutiple Custom Fields
-
Hi,
So I’m trying to utilize this plugin as a way for owners of food trucks to submit where they’re be each day. But I don’t see a way and maybe I just don’t know how to do it, but to require multiple custom fields.
I need to have them be able to fill out the location they’re be at, the hours, address and additional details.
Also, is there a way to not have the submission appear as blog posts, but only on wordpress pages? I basically don’t have time to review all submissions and want them all to go to a single page so people can easily click on the menu header and then see where all the food trucks will be for that day. Thanks
-
Glad to help.
The free version of USP provides only one custom field, so maybe not a good fit for what you are trying to do.
To change the post type, follow this guide. Basically add a code snippet, edit the code to say
page
, and done.I hope this helps, let me know if I can provide any further infos.
Awwww. I didn’t realize you had a pro version. That may be exactly what I need then. Okay, so the code snippet you provided.
Will that allow every submitted post to appear under one specific page? Let me explain, so my idea and let me know if you have a better way to do this is that each food truck will submit their information.
I’ll give all the food truck owners a specific URL with the form on it only they can see. Once they fill out the information this will create a separate page in WordPress for each submission, that’s fine as I can easily delete old pages to not clog up stuff.
Reason I need it as a page is I don’t want anything to appear on the main blog or feed.
I would then use the special shorthand code on another page, example, Food Truck Locations. This would be the main area all the submitted posts show. But when I use the following shorthand code on the page:
[usp_display_pages userid=”all”]
None of the pages show up at all. So that code you provided me, will that solve that and now let all the submitted pages show under that one page?
Sorry and I hope I make sense. This is all new to me.
Thanks
Josh- This reply was modified 3 years, 1 month ago by drastikone1.
Glad to help:
1) “Will that allow every submitted post to appear under one specific page?”
No, it will change the submitted posts status to page instead of post. In order to display all submitted posts on a page, you can either use the
[usp_display_posts]
shortcode, or even better set up a custom page template in your theme (or child theme).2) “On a specific page (the one that would lists all the posts) none of the pages show up at all. So that code you provided me, will that solve that?”
No, as explained the code snippet only changes the post type from
post
topage
. So any user submitted posts will actually be user submitted pages.I appreciate the help.
1. Okay. So right now I have the Post Type in the settings as WP Post (recommended) do i need to change that to WP Page before adding the code?
2. I’ve tried using the [usp_display_posts] shortcode on the page I wanted everything to appear but nothing shows up. I assume I need to first install that code you provided me? I did do some test submissions. If I do as a post (choosing the WP post under settings) then it will show the correct stuff on the page, but if I choose WP page nothing will show on the page with the shorthand code. The shorthand code is installed correctly, but nothing shows on the page.
3. I didn’t know if you meant change every word in the script that said post to page? Here is the script after I did that? If not, please let me know exactly what to change to page?
Here is the code I’m using:
// USP submit posts to CPT function usp_modify_page_type($page_type) { return 'book'; // change this to the slug of your page type } add_filter('usp_page_type', 'usp_modify_page_type');
4. I plan to buy the premium plugin as that will solve one of my issues, but just need to be able to have one specific page display all the user submitted posts since it just shows blank even with the shorthand code. I’m assuming I need to first get the code correct?
And I apologize if I’m misunderstanding something. and I can also post a video that shows the work flow I’m trying to achieve if that helps lol as I’m not sure if I’m even explaining it correctly in words lol
- This reply was modified 3 years, 1 month ago by drastikone1.
- This reply was modified 3 years, 1 month ago by drastikone1.
- This reply was modified 3 years, 1 month ago by drastikone1.
1) Actually you don’t need any code. I forgot that the plugin gives the option to use pages instead of posts. So all you need to submit pages instead of posts is to enable the plugin option called “Post Type”. Don’t forget to save changes.
2) “I assume I need to first install that code you provided me?”
No, you don’t need any code, see previous response. I’m not sure what all you have going on, but in general the display posts shortcode displays only submitted posts that are published. So that would be the first thing to check.
“I wasn’t sure if you meant change every single word that says post to page? I don’t know how to really code or anything. So I just posted the code after I modified it or was I only supposed to change a certain word to page?”
No, just delete that code snippet, do not use it; it is not needed, see previous two responses.
3) “I’m assuming I need to first get the code correct?”
No, please do not use the code, it is not needed. See previous replies.
“I plan to buy the premium plugin as that will solve one of my issues”
I would not recommend, as the pro version is very advanced and aimed at experienced WP users who are familiar with basics like custom fields, shortcodes, etc. Also if you do have any more questions about pro version, please send via our contact form and we’ll respond asap. (The forums here at www.ads-software.com are for free versions of plugins only; any discussion of pro versions is prohibited.)
Okay. Now that we cleared up that I don’t need the code. I think we are getting close to getting this resolved.
1. So I have went into Plugin Settings, under General Settings and Post type I have it changed to WP Page and made sure to save.
2. Under Plugin Settings I have modified what I wanted my form to say under form fields and made sure to save.
3. I also make sure under plugin settings, under general settings to change it to publish immed for post status and then hit save.
4. I have a created a WordPress page called Submit your Food Truck location. I use the shorthand code:
[user-submitted-posts] and then I go to the page and I see the form I created. Not a problem there, the form shows perfectly.4. I now enter a test submission and I get the proper submission confirmation.
5. I get a email alert letting me know someone submitted information.
6. I go back to WordPress and see in WordPress under pages a new page created with the information that was submitted. All of that works fine.
7. I create a new WordPress page called Find A Food Truck. And on this page I have the shortcode: [usp_display_posts] and hit save.
8. This is the main problem I’m having. When I go to this page, reload it, nothing is showing up at all. It won’t display anything. It should display all of the pages that were created. So since I only submitted 1 it should show 1 page but it doesn’t.
9. Now I tested this to see if there was a issue. I went back to Plugin Settings and changed the post type to WP Post and saved everything. Submitted everything again and when I finally get back to the Find a Food Truck page it will show the post I made while it’s using WP Post. It also shows up on my main blog feed which makes sense. ANyhow…
10. So it works perfectly if it’s set to WP Post under plugin settings except for showing on my main site, but if I set it to WP Page in the plugins settings nothing ends up showing on that final page.
Once again, the form shows up perfectly in both cases. The issue is on the final Find A Food Truck page with the [usp_display_posts] shorthand code nothing shows if the post type is changed to WP Page. I hope I explained this well enough. That’s literally the main problem I’m having.
This is the problem I was trying to get across earlier. When I reload this page, nothing is showing up. It won’t display anything.
Ah, actually you have found a bug. The display-posts shortcode should be displaying submitted posts and/or pages. Definitely will get that fixed up in the next plugin update.
For #10: “except for showing on my main site”
That is not something the plugin controls; it’s up to the theme. With WordPress, plugins add functionality (like submit posts), while themes display content (like posts) as needed. So to modify where posts are displayed in your theme, best advice would be to ask your theme provider.
Also for this: “The issue is on the final Find A Food Truck page with the [usp_display_posts] shorthand code nothing shows if the post type is changed to WP Page”
Yes that sums it up. The reported issue is due to the above-described bug. Will be fixed for the next plugin update.
Awwww…I figured it had to be a bug or I was going crazy lol. Thank you so much for the help. This plugin will be exactly what I need then when the update is performed. Thank you!
Replied to your email just now, thank you.
Just to follow up with this. The next version of USP includes a
post_type
attribute for the[usp_display_posts]
shortcode. So if you do this:[usp_display_posts]
..the list will display only published submitted posts (default).
To instead display published submitted *pages*, do this:
[usp_display_posts post_type="page"]
Or to display both posts and pages:
[usp_display_posts post_type="any"]
I hope this helps. Thanks again for reporting, @drastikone1.
- The topic ‘Mutiple Custom Fields’ is closed to new replies.