php - How can I insert a post into wordpress and associate it with a category? -


I have content from other places that I would like to include in Wordpress as a post and then affiliate to an existing category I am It is very easy to insert a new post in the wp_posts table, but I can not seem to know how to create a query to enter a new post and associate the post with the category at the same time .

Use this query: Include wp_posts (post_title, post_content, post_name, post_date, post_date_gmt, post_modified, post_modified_gmt, post_author, post_status) value ('title', 'text', '(_id_of_above_post), 1)

/ Code> , now (), now (), now (), now (), 1, 'publish') / div>

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -