Updated on 20 Feb 2023
This members-only tutorial provides the steps to use Advanced Custom Fields to build a form that logged in users can fill on the front end to submit news i.e., populate a Custom Post Type as drafts in Oxygen.
Admin can then review and publish the entries which can be easily set to appear on the front end using an Easy Posts or a Repeater component.
Non logged-in visitors will see
Step 1
Let's create the News CPT.
Install and activate Custom Post Type UI.
Step 2
Install and activate ACF or ACF Pro.
Add a new field group titled say, "News Fields".
In this example, since we want the users to enter the URL of their news source, add a Url type field (news_source
).
Also, add an Image type field (news_image
) that will be mapped later to the featured image of the News CPT entry.
Set the field group to appear on News CPTs.
Step 3
Let's map the image custom field to the CPT entry's featured image.
Install and activate Code Snippets plugin.
Go to Snippets > Add New.
Title: Set uploaded image as the featured image for news articles and call acf_form_head()
Code:
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.