Wordpress - 使用MySQL

时间:2018-04-25 18:37:05

标签: mysql wordpress

我正在尝试使用MySQL在Wordpress中添加带有图像的精选帖子。我想只通过MySQL(没有PHP,只有SQL)来做。我试图添加帖子,然后我也为帖子添加了元数据。不过,我看不到有图片的精选帖子。请告诉我哪里错了?我已经为记录生成了XML,请检查并告诉我错误的地方。

发布数据:

<?xml version="1.0" encoding="utf-8"?>

<table_data name="wp_posts">
    <row>
        <field name="ID">62</field>
        <field name="post_author">1</field>
        <field name="post_date">2018-04-24 00:00:00</field>
        <field name="post_date_gmt">2018-04-24 00:00:00</field>
        <field name="post_content">&lt;img class="alignnone size-medium wp-image-26" src="http://test.com/wp-content/uploads/2018/photos/testing2.jpg" alt="test" width="300" height="219"&gt;</field>
        <field name="post_title">Manual post</field>
        <field name="post_excerpt"></field>
        <field name="post_status">publish</field>
        <field name="comment_status">open</field>
        <field name="ping_status">open</field>
        <field name="post_password"></field>
        <field name="post_name"></field>
        <field name="to_ping"></field>
        <field name="pinged"></field>
        <field name="post_modified">0000-00-00 00:00:00</field>
        <field name="post_modified_gmt">0000-00-00 00:00:00</field>
        <field name="post_content_filtered"></field>
        <field name="post_parent">0</field>
        <field name="guid"></field>
        <field name="menu_order">0</field>
        <field name="post_type">post</field>
        <field name="post_mime_type"></field>
        <field name="comment_count">0</field>
    </row>
    <row>
        <field name="ID">63</field>
        <field name="post_author">1</field>
        <field name="post_date">2018-04-24 00:00:00</field>
        <field name="post_date_gmt">2018-04-24 00:00:00</field>
        <field name="post_content"></field>
        <field name="post_title">testing2</field>
        <field name="post_excerpt"></field>
        <field name="post_status">inherit</field>
        <field name="comment_status">closed</field>
        <field name="ping_status">open</field>
        <field name="post_password"></field>
        <field name="post_name">testing2</field>
        <field name="to_ping"></field>
        <field name="pinged"></field>
        <field name="post_modified">0000-00-00 00:00:00</field>
        <field name="post_modified_gmt">0000-00-00 00:00:00</field>
        <field name="post_content_filtered"></field>
        <field name="post_parent">62</field>
        <field name="guid">http://test.com/wp-content/uploads/2018/photos/testing2.jpg</field>
        <field name="menu_order">0</field>
        <field name="post_type">attachment</field>
        <field name="post_mime_type">image/jpeg</field>
        <field name="comment_count">0</field>
    </row>
</table_data>

后期元

<table_data name="wp_postmeta">
    <row>
        <field name="meta_id">211</field>
        <field name="post_id">62</field>
        <field name="meta_key">_thumbnail_id</field>
        <field name="meta_value">63</field>
    </row>
</table_data>

缺少什么以及如何使用MySQL添加?

由于

0 个答案:

没有答案