WordPress.org

Ready to get started?Download WordPress

Forums

Creating Posts Programmtically. (2 posts)

  1. tanver
    Member
    Posted 3 years ago #

    Hi friends,
    I am in need of creating posts - basically copying post from one blog to other blog, where potentially posts might exist with the same ID - by writing a piece of code using PHP. I am planning to usethe function wp_insert_post() to insert the posts in the database. Is this the right way to do this? and would really appreciate if someone can tell me what tables of the database is it going to affect?
    TIA

  2. tanver
    Member
    Posted 3 years ago #

    This is what I am trying to do but unfortunately, the piece of code is not working for me

    [Code moderated as per the Forum Rules. Please use the pastebin]

    It gets into the 'Inserted Post ID: ' thing but actually no ID is being assigned to the Posts.
    TIA

Topic Closed

This topic has been closed to new replies.

About this Topic