Support

Account

Home Forums Front-end Issues Front End Form Category field not working

Unread

Front End Form Category field not working

  • i have created a front end form to create a new post, and its working fine except one problem.

    i want to assign category to this post from front end and used a Taxonomy field type, but somehow their is some conflict with genesis theme, so i decided to use simple dropdown field and save the value to Post_category, but the value is not saved in to DB. here is the code part.

        $post = array(
            'post_status'  => 'draft' ,
            'post_title'  => $_POST['fields']['field_53b5105fc69e0'],  
    		'post_content' => $_POST['fields']['field_53b510fbc69e2'], 
    		'post_thumbnail'  => $_POST['fields']['field_53b51083c69e1'],
    		'post_category'  => $_POST['fields']['field_53de0c59b3833'],
    		
            'post_type'  => 'post' ,
        );  
     
    // insert the post
        $post_id = wp_insert_post( $post );
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.