Support

Account

Home Forums Backend Issues (wp-admin) Front-end for saves post title but not ACF content

Solved

Front-end for saves post title but not ACF content

  • Hi, I’ve searched all over for an answer to this and I’m really struggling…

    All I’d like to do is create a new custom post from a front end form, and save all the field content to the database.

    Currently, the_title is saving, but none of the ACF content that I input on the front-end is saving.

    Here is my code:

    <?php
    /*
    Template Name: Submit Recipe
     */
    acf_form_head();
    get_header();
    ?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    <?php acf_form(array(
            'post_id' => 'new_post',
    	'new_post' => array(
    	'post_type'	=> 'recipes',
    	'post_status' => 'publish'
        ),
        'post_title' => true,
        'submit_value' => 'Submit recipe'
     )); ?>
    
    <?php endwhile; ?>
    
  • You may have something else that’s interfering with the save.

    Try turning on debugging and see if you get any errors. Add the following to wp-config.php

    
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_DISPLAY', true );
    

    You might also try deactivating other plugins on the site and possibly switching to the default WP theme to see if any of those are causing the issue.

  • Debug mode didn’t show anything up but I’ve worked out that it was clashing with a custom plugin that’s been developed.

    Obvious test to do, thank you!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Front-end for saves post title but not ACF content’ is closed to new replies.