开发者

Wordpress page creation using MySQL query -- not working

I am trying to create a Wordpress page using MySQL query. Here is my query.

INSERT INTO wp_posts (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_title`, `post_excerpt`, `post_status`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`, `menu_order`,开发者_如何学运维 `post_type`, `post_mime_type`, `comment_count`) 
VALUES (1, '2010-11-29 14:05:04', '2010-11-29 08:05:04', 'cool.', 'Nice', '', 'publish', 'open', 'open', '', 'nice', '', '', '2010-11-29 14:05:04', '2010-11-29 08:05:04', '', 0, 'http://exampleurl.net/', 0, 'page', '', 0);

If I execute the above query, it creates new page. Now if I try to go the page using browser, it shows me this

Not Found
Apologies, but the page you requested could not be found.

NB: I am using custom permalink: /%category%/%postname%.


What are you doing!? Don't use raw SQL for inserting posts, use the function wp_insert_post()!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜