The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Inserting the post from frontend wordpress (1 post)

  1. luitelbj
    Posted 3 years ago #

    I'm trying to insert the post from frontend along with custom meta field wordpress below is my code

    $post = array(
                'post_title' => wp_strip_all_tags( $title ),
                'post_content' => $description,
                'post_category' => $_POST['cat'],  // Usable for custom taxonomies too
                'tags_input' => $tags,
                'post_status' => 'publish',         // Choose: publish, preview, future, etc.
                'post_type' => $_POST['post-type']  // Use a custom post type if you want to
            $insert=wp_insert_post($post);  // http://codex.wordpress.org/Function_Reference/wp_insert_post
            update_post_meta($insert, "player_info", "Hello I'm Bijay");

    well the problem is i created meta box on post, and i've to insert the post from frontend and i tried to insert the post via above code, but its not posting on that metabox, it making new custom-field and saving it there.

    Please help me, Thanks in advance :)

Topic Closed

This topic has been closed to new replies.

About this Topic