Como adicionar uma miniatura em destaque no XML de importação?

4

Este é um item de amostra que estou tentando inserir no WordPress como postagem.

<item>
    <title>XXXXXX</title>
    <link>xxxx/xxxxx</link>
    <pubDate>2012-05-23 19:31:00</pubDate>
    <dc:creator><![CDATA[admin]]></dc:creator>
    <guid isPermaLink="false">http://wordpress/?p=xxxx</guid>
    <description></description>
    <content:encoded><![CDATA[Sample]]></content:encoded>
    <excerpt:encoded><![CDATA[]]></excerpt:encoded>
    <wp:post_id>27505</wp:post_id>
    <wp:post_date>2014-04-05 10:01:11</wp:post_date>
    <wp:post_date_gmt>2014-04-05 10:01:11</wp:post_date_gmt>
    <wp:comment_status>open</wp:comment_status>
    <wp:ping_status>open</wp:ping_status>
    <wp:post_name>xxxxxx</wp:post_name>
    <wp:status>publish</wp:status>
    <wp:post_parent>0</wp:post_parent>
    <wp:menu_order>0</wp:menu_order>
    <wp:post_type>post</wp:post_type>
    <wp:post_password></wp:post_password>
    <wp:is_sticky>0</wp:is_sticky>
    <category domain="category" nicename="blog"><![CDATA[blog]]></category>
</item>

Como incluir uma imagem em destaque neste XML, existe uma maneira de fazer isso?

    
por Nikhil 07.04.2014 / 07:40

1 resposta

2

Conseguimos uma solução de trabalho

Este é o item de postagem

<item>
    <title>title1</title>
    <pubdate>2013-02-20 10:33:58</pubdate>
    <dc:creator>
    <![CDATA[ David Jennings ]]>
    </dc:creator>
    <guid ispermalink="false">http://wordpress/?p=1234</guid>
    <description>
    <title>Title</title>
    </description> 
    <content:encoded>
    <![CDATA[ABCD]]>
    </content:encoded>
    <excerpt:encoded>
    <![CDATA[ ]]>
    </excerpt:encoded>
    <wp:post_id>1234</wp:post_id>
    <wp:post_date>2013-02-20 10:33:00</wp:post_date>
    <wp:post_date_gmt>2013-02-20 10:33:00</wp:post_date_gmt>
    <wp:comment_status>open</wp:comment_status>
    <wp:comment_status>open</wp:comment_status>
    <wp:ping_status>open</wp:ping_status>
    <wp:post_name>title1</wp:post_name>
    <wp:status>publish</wp:status>
    <wp:post_parent>0</wp:post_parent>
    <wp:menu_order>0</wp:menu_order>
    <wp:post_type>post</wp:post_type>
    <wp:post_password></wp:post_password>
    <wp:is_sticky>0</wp:is_sticky>
    <category domain="category" nicename="blog"> <![CDATA[ blog ]]> </category>
    <wp:postmeta>
    <wp:meta_key>_thumbnail_id</wp:meta_key>

    <wp:meta_value><![CDATA[888888]]></wp:meta_value>

    </wp:postmeta>
</item>

Este é o item de anexo

<item>
    <title>title2</title>
    <link>http://wordpress/?attachment_id=888888</link>
    <pubDate>Mon, 07 Apr 2014 07:04:24 +0000</pubDate>
    <dc:creator><![CDATA[admin]]></dc:creator>
    <guid isPermaLink="false">http://wordpress/wp-content/uploads/xx/xxx/image.jpg</guid>
    <description></description>
    <content:encoded><![CDATA[]]></content:encoded>
    <excerpt:encoded><![CDATA[]]></excerpt:encoded>

    <wp:post_id>888888</wp:post_id>

    <wp:post_date>2014-04-07 07:04:24</wp:post_date>
    <wp:post_date_gmt>2014-04-07 07:04:24</wp:post_date_gmt>
    <wp:comment_status>open</wp:comment_status>
    <wp:ping_status>open</wp:ping_status>
    <wp:post_name>title2</wp:post_name>
    <wp:status>inherit</wp:status>

    <wp:post_parent>1234</wp:post_parent>

    <wp:menu_order>0</wp:menu_order>
    <wp:post_type>attachment</wp:post_type>
    <wp:post_password></wp:post_password>
    <wp:is_sticky>0</wp:is_sticky>
    <wp:attachment_url>http://wordpress/wp-content/uploads/xx/xxx/image.jpg</wp:attachment_url>
    <wp:postmeta>
    <wp:meta_key>_wp_attached_file</wp:meta_key>
    <wp:meta_value><![CDATA[/xx/xxx/image.jpg]]></wp:meta_value>
    </wp:postmeta>
</item>
  1. Crie postagens para anexos e postagens.
  2. Adicionar relação no post e no anexo.
  3. Importar XML O anexo relacionado deve ser adicionado como imagem em destaque.
por Nikhil 07.04.2014 / 13:50

Tags