Support » Plugins » Hacks » Front end post from file "outside" wordpress,

  • GrundeLL



    So I’ve written a json / java / backbone app that will do a couple of translations and then i need to post it to the DB…

    The thing is that the file that I have as post file stands “outside” wp which makes the front end posting a little harder…

    What i wonder is simply how I should connect to and be able to post from a file outside the WP libary but still needs to go in to the WP post table.

    Would lobe to get some help.

    Best Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • michael.mariart


    The best way that I can think of is to use a home page template and add your extra code to that. If your theme doesn’t have it, you can create a file called front-page.php and it will be used automatically for the sites home page layout.

    Tarsem Singh


    First of all Create a Page With Form for Post Values e.g. Title, Description, Category etc. and Extra Meta Data.

    Example Code ….

    $myPost = array(
        'post_title' => $_POST['postTitle'],
        'post_status' => $postStatus, //  @See
        'post_author' => $userID, // you can set Post author ID at here eg. Current Logged in User see
        'post_category' => array($_POST['category'])
    // Now Insert Post Data into DB
    $postId = wp_insert_post($myPost);
    // for custom Meta data
    add_post_meta($postId, 'duration', mysql_real_escape_string($_POST['duration']), true);
    add_post_meta($postId, 'country', mysql_real_escape_string($_POST['country']), true);

    Finally your post has been submitted.

    Tarsem Singh


    There’s a chrome extension which you can use to post from anywhere on the web

    Might be useful, not sure it does exactly what you need though?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Front end post from file "outside" wordpress,’ is closed to new replies.