-3
A
回答
1
基本上你所要做的就是在Wordpress的wp_posts
表中插入你的記錄。該表具有以下字段(如果你使用最新的3.9.2版本,當然):
ID - (no explanation needed, it is auto-increment value)
post_author - (here in your case put 1 - this is Administrator account)
post_date - (no explanation needed)
post_date_gmt - (same as above, but date is GMT)
post_content - (your article content, HTML code, if any, may or may not be escaped)
post_title - (no explanation needed)
post_excerpt - (can be empty in your case)
post_status - (there are six of them, in your case put "publish" or "draft" if you want manually to make post visible at later stage)
comment_status - (put "closed" if you want to disable comments or "open" otherwise)
ping_status - (same as above, but it applies for ping)
post_password - (put empty string)
post_name - (put lowercase converted post title, but replace spaces with "-", this is URL friendly version of the post name, ex: my-first-post-title)
to_ping - (put empty string)
pinged - (put empty string)
post_modified - (put date of the post)
post_modified_gmt - (same as above, but date is GMT)
post_content_filtered - (put empty string)
post_parent - (put 0 initially, later you can build your post hierarchy)
guid - (URL of the post, http://www.yourdomain.com/?page_id=the_ID_of_the_post)
menu_order - (put 0)
post_type - (put "page" or "post", there is a difference though)
post_mime_type - (put empty string)
comment_count - (put empty string)
這裏是例如SQL查詢與插入成功所需的最低值:
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,'2014-08-28 02:00:00', '2014-08-28 00:00:00','<h1>Some content</h1>',
'My first post','Some excerpt','publish','closed', 'closed','','my-first-post',
'','','2014-08-28 02:00:00', '2014-08-28 00:00:00','',0,
'http://127.0.0.1/wordpress/?page_id=2000',0,'post','','')
記住,您的表wp_posts
可能有一個前綴。
相關問題
- 1. 自定義文章的Wordpress自定義文章
- 2. wordpress導入joomla文章
- 3. WordPress的頁面和自定義文章
- 4. Woocommerce - Wordpress Hotel/Room自定義文章
- 5. wordpress自定義文章類型
- 6. WordPress自定義文章類型Single.php?
- 7. WordPress自定義文章編輯器?
- 8. WordPress的自定義文章類型
- 9. WordPress的自定義文章格式?
- 10. 如何在wordpress中自定義文章?
- 11. WordPress的自定義文章類型PHP
- 12. 表格帖子自定義文章 - WordPress
- 13. Wordpress文章的自定義模板
- 14. WP自定義文章類型導航
- 15. 在wordpress中遷移數據庫後導入附加到文章的文件
- 16. 自定義文章網址?
- 17. 自定義文章類型
- 18. 從另一個自定義數據庫導入wordpress到wordpress
- 19. 自定義文章類型的WordPress自定義搜索頁面
- 20. WordPress的自定義文章類型導航+兒童
- 21. wordpress 3:爲自定義文章類型創建導航菜單
- 22. 如何從自定義文章類型
- 23. 添加分頁到自定義文章
- 24. Wordpress API插入文章?
- 25. 導出OpenCms的文章到Wordpress
- 26. 從WordPress創建iCal訂閱鏈接自定義文章類型
- 27. wordpress自定義字段從現有的文章
- 28. wordpress預定義格式文章
- 29. 數據庫文章:分頁
- 30. 在WordPress後添加到自定義文章類型類別從前端(WordPress的)
謝謝你的努力,它幫助了我很多。 – 2014-08-27 10:47:06