• Resolved helli

    (@helli)


    I think there is a bug in the xml import/export function new in 2.1: The excerpt of a post is not in the xml export. Any idea to fix it?

    Helli

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter helli

    (@helli)

    Ok, I have fixed the problem by myself:

    In wp-admin\export.php from Line 170:

    <description></description>
    
    <excerpt:encoded><![CDATA[<?php echo $post->post_excerpt ?>]]></excerpt:encoded>
    
    <content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>

    and in wp-admin\import\wordpress.php from Line 228:

    
       $post_author    = $this->get_tag( $post, 'dc:creator' );
    
       $post_excerpt   = $this->get_tag( $post, 'excerpt:encoded' );
       $post_excerpt = str_replace(array ('<![CDATA[', ']]>'), '', $post_excerpt);
       $post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
       $post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
       $post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
    
       $post_content = $this->get_tag( $post, 'content:encoded' );
    

    Works perfect for me.

    Helli

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Might want to submit your change. Info can be found at https://trac.www.ads-software.com.

    marksinzi

    (@marksinzi)

    I have also had a problem importing an old WordPress file. I was using the WordPress.com ‘s website as the host (marksinzi.worpress.com). Then I found another host, 110mb.com. I downloaded the WordPress 2.1 files to my computer. Then I uploaded them to my site on 110mb.com (marksinzi.110mb.com/worpress/) All of this seems to work, I even uploaded a different theme and it worked.

    SO then I exported from WordPress.com (rec’d an .xml file).

    I went to the wp-admin for the site on 110mb.com, and tried the import function. I got this error:

    Import WordPress
    The uploaded file could not be moved to /www/110mb.com/m/a/r/k/s/i/n/z/marksinzi/htdocs/wordpress/wp-content.
    Warning: Cannot modify header information – headers already sent by (output started at /www/110mb.com/m/a/r/k/s/i/n/z/marksinzi/htdocs/wordpress/wp-admin/admin-header.php:16) in /www/110mb.com/m/a/r/k/s/i/n/z/marksinzi/htdocs/wordpress/wp-includes/functions.php on line 1219

    I saw Helli’s fiz for the export.php and import.php files for WP 2.1. But how do I fix the export.php if I am using WordPress.com?

    Try removing the header statement from you datafile generator..

    header (“Content-Type: text/xml; charset=UTF-8”)

    Or try flushing your cache

    I don’t know why this topic shows as resolved – it is still an issue in 2.3.2 — post excerpts do not export or import.

    Thanks for the fix, Helli – although the line #’s have changed on more recent versions.

    (I’ve submitted the change in the trac.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP 2.1: xml export/import’ is closed to new replies.