show custom value from frontend form in a post (custom post type)
Refer to the parameters section in the documentation for wp_insert_post. Custom fields (meta data) must be passed in the form of a key/value array with the parameter name ‘meta_input’. Change ‘post_custom_field’ => $add to ‘meta_input’ => array( ‘post_custom_field’ => $add ) To show the value, use the get_post_meta function. get_post_field is only for the native … Read more