• Hi all,

    I just wanted to ask a few questions about automatically created pages/posts from a form.

    Is it possible/difficult to create a form that allows the user to enter a title, text, url, image that automatically generates a post/page? I have been looking at formidable forms, just curious about the output to post side.

    The idea is for the user to enter the above details, have an individual artist post/page and then the image they have uploaded also be added to a combined gallery. The page generated doesn’t need to be editable by the user later.

    Also I am looking for a plugin that will display images (maybe 20 a day) in order from a folder. eg. 100 images (1 to 20, 21 to 40 etc) changing every 24 hours

    All help is greatly appreciated
    Thanks
    Ray

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s not that difficult if you can code PHP. I would suggest you start with a custom page template to contain the code. Output the form for normal GET requests, and have the form POST to the same page. When a POST comes in, sanitize and validate the data, upload the image, then add a post with wp_insert_post().

    To conform to the normal WP practice, the image should be connected with a new attachment post type that is a child of the main post. Be very careful which users are allowed to do this. Allowing this with the general public without screening, especially involving uploading anything, even images, greatly increases the chances of being hacked. At the very least, this sort of thing attracts spammers. Seriously consider aggressive anti-spam measures. The images must be verified that they are true image files. Do not accept uploads from formats that can easily contain payloads, such as .bmp.

    I don’t know of such a plugin, but since the images are tied to posts, you only need to query for the 20 most recent posts and output their associated images. Again, not that difficult if you can code PHP.

    Thread Starter necrofrantic

    (@necrofrantic)

    Thank you bcworkz. This answered my questions. Looks like I’m learning PHP 🙂

    • This reply was modified 7 years, 3 months ago by necrofrantic.
    Moderator bcworkz

    (@bcworkz)

    You’re welcome!
    You don’t sound too disappointed at the prospect of learning PHP. I think it’s well worth learning — it’s very empowering when working with websites. I hope I didn’t make this sound too easy. I forget how confusing a new language can be. It’s going to take a while to get everything together. Avoid feeling overwhelmed by focusing on one small task at a time. Having a real project to learn with is the best teaching tool I know of.

    Good luck and have fun with it!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Form to automated posts and gallery – Art page’ is closed to new replies.