ACF has documentation for creating a form on the frontend. I would stick to their suggestions. https://www.advancedcustomfields.com/resources/create-a-front-end-form/
I was able to create this by assigning my field group for the form to the custom post type and using a unique template page for the form.
<?php
/**
* Template Name: Form Page Template
*/
?>
<?php acf_form_head(); ?>
<?php get_header(); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php acf_form(array(
'post_id' => 'new_post',
'new_post' => array(
'post_type' => 'cpt-teste',
'post_status' => 'draft'
),
'submit_value' => 'Submit'
)); ?>
<?php endwhile; ?>
<?php get_footer(); ?>
Related Posts:
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- add_image_size() for specific Post Types
- Creating an Image-Centric Custom Post Type?
- How to disable generation of default image sizes for some custom post types?
- Why does my custom WP role need edit_posts to edit images?
- Get post ID from wp_insert_post()
- WP insert post and custom taxonomy
- set_post_thumbnail_size in percent, not pixels?
- Custom post type Admin Page
- How do I programmatically add items of content to a custom post type?
- Not Able to Insert Taxonomy Term Using wp_insert_post()
- Extract image src from a post and send it to an external form
- Removing Image Sizes for Custom Post Type
- How I upload, save and set a featured image from my frontend?
- Image size filtering in Media uploader according to custom post type
- Trying to save custom post type from frontend partially working
- Count all images of a certain post type
- How to get source of custom meta image?
- Assign category to front end post
- Stopping WordPress from Auto Generating Image Files for Sizes
- Uploaded image not appearing in custom post type
- How can I programmatically save data into custom fields that contain serialized data?
- How to get category image custom post type taxonomy in wordpress?
- WordPress tax_input only if logged in
- Programmatically adding posts
- add_image_size for post type
- Set Custom Image Size Just For Specific Custom Post Type
- Issue to get wp_get_attachment_image with cmb2
- How to rename image at uploading on specific plugin or post-type in WordPress
- How to insert multiple images into a single post within a CPT
- Adding class to featured image
- Is it possible to create a post using a metabox?
- How to auto increment post title & post slug field?
- Auto-generated posts not showing in backend (but being counted!)
- List all images from a single post meta value
- wp_insert_post generates endless posts
- uploading images to specified directories
- create parent post using wp_insert_post
- Get image post ID in media upload
- Link to full size post thumbnail
- Hide editor while keeping add media button in custom post type
- Custom Post Type with image gallery
- Multiple featured sizes / images / excerpts
- How to Create an Image Upload Box for Custom Posts?
- Cron job for creating posts not excecuting properly
- How to checked selected category checkbox when my custom post inserted from frontend
- Problems with image size on the server WordPress
- frontend image post uploader
- Post author for revision not being set on update/insert
- Adding custom image sizes and post types to a plugin or to a theme?
- Add CPT values to Database
- How to handle large number of images in a post?
- How do you get the full size url of an attachment image
- How to add multiple images to a custom post type without plugin [closed]
- Why cant I add a custom post type to a custom taxonomy?
- How can i link a custom post type thumbnail to intermediate size
- wp_insert_post wrong post type [closed]
- Programatically inserted posts not showing in Posts Table
- Update post if exist from PHP
- How do you output an unknown number of images in a custom post type with desired markup?
- WordPress hook which triggers on post import
- How to handle new post from API request?
- copy images from custom field to another custom field
- How to handle this specific case of custom post type?
- Using Image Sizes for Custom Post Types outside the Loop
- link featured image to external link
- importing table data to custom post type
- How can I get some of a posts meta data whilst it is still inserting?
- Should i use custom post type for a custom footer?
- Returning an image url from its attachment ID using a custom post type plugin
- Images not load on custom post type sidebar, related posts
- wp_insert_post from XML feed only inserting first post
- What is the correct way that when creating a custom post type assign values to custom fields created with pods framework?
- DIVI Theme customizer changes not applied on existing pages and designs are not shown on the front
- How do I find out which (page) template file my custom child post is looking for?
- How can I add image sizes for a specific custom post type?
- Dupplication of Custom Post Type while adding attachment
- Media is not showing on post page
- How to insert post 6 times after user register like ask.fm
- Multi Photo Upload with Caption on Front End for Custom Post Type
- automatic creation of custom post type articles
- Displaying image instead of post label in wordpress
- Links Image in “Catalog” Page to Posts
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- How do I set a specific size for my image?
- Trying to get custom post type attachment images to function in indexed array
- Generate slug and meta data if meta field is empty
- Add a image to a post published on a CPT from the front-end
- wordpress form processing to custom post type not working
- Image paths on custom post types getting /post_type/ added to path
- install.php Custom Taxonomy Term not being added to custom post
- Retrieve post data via WPDB class
- Omitted Content After Post-Publish Insertion
- How to Create a Frontend Html-list Editable in the Backend?
- Is this the correct way to add post-slug input field?
- img src not working correctly in custom post type
- Add a background image into a post [closed]
- Front end post or photo or both
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?