Support

Account

Home Forums Front-end Issues Custom Post Type Edit Latest Post on the Front-end please

Solving

Custom Post Type Edit Latest Post on the Front-end please

  • Hi I know I will have to create a template to have the edit form but am having trouble getting started as all I find is for add new posts.
    I only want to edit the latest “Conferences” post and it to be on the front end of the site in a password protected page.

    I have this bit of code but not sure if it needs more to be added to it?

    
    acf_form(array(
             'post_id' => 'editing_post',
             'field_groups' => array(35), // Used ID of the field groups here.
             'post_title' => true,
             'post_content' => true, 
             'form' => true,
             'editing_post' => array(
                 'post_type' => 'conferences',
    	     'numberposts' => 1,
                 'orderby' => 'date',
                 'order' => 'DESC',
                 'post_status' => 'publish' 
             ),
             'return' => '%post_url%',
             'submit_value' => 'Submit Photos',
         ));
    

    As this is a page template and not the actual post page will this work?
    The person will only be able to access it by adding the correct password to the password protected page. I will hide most fields by css as it will only be an upload file that needs to be seen. The uploads will then dynamically show up on the “Conference Post Page” if that makes sense.

  • Hi I also need to know if this will work on a page template or do I create a conferences_single.php?

  • If you want to edit a specific post then you would supply that post ID here

    
    'post_id' => 'editing_post',
    

    If you want to edit the current post, shown on {$post-type}-single.php the you would leave that argument unset.

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

You must be logged in to reply to this topic.