Support » Themes and Templates » Import Featured Items with WordPress XML file

  • I am using a theme called Transcript by Gabfire. I am trying to import a large number of posts from a bespoke CMS into WordPress via the XML import option.

    I’ve been able to get everything except to somehow set a featured image for each post. The <wp:attachment_url> does not work. In MySQL, the main settings have to do with the _postmeta table. Here’s some SQL from that table:

    INSERT INTO tablename_postmeta (meta_id, post_id, meta_key, meta_value) VALUES (1, 2, ‘_wp_page_template’, ‘default’),
    (991, 1126, ‘_wp_attached_file’, ‘2010/12/1_news_7525.jpg’),
    (992, 1126, ‘_wp_attachment_metadata’, ‘a:6:{s:5:”width”;s:3:”512″;s:6:”height”;s:3:”234″ ;s:14:”hwstring_small”;s:23:”height=”58” width=”128””;s:4:”file”;s:23:”2010/12/1_news_7525.jpg”;s:5:”sizes”;a:15:{s:9:”thumbnail” ;a:3:{s:4:”file”;s:23:”1_news_7525-150×150.jpg”;s:5:”width”;s:3:”150″;s:6:”height”;s: 3:”150″;}s:6:”medium”;a:3:{s:4:”file”;s:23:”1_news _7525-300×137.jpg”;s:5:”width”;s:3:”300″;s:6:”height”;s: 3:”137″;}s:14:”post-thumbnail”;a:3:{s:4:”file”;s:21:”1_news_7525-50×50.jpg”;s:5:”width”;s:2:”50″;s:6:”height”;s:2:” 50″;}s:13:”trns-featured”;a:3:{s:4:”file”;s:23:”1_news_7525-342×156.jpg”;s:5:”width”;s:3:”342″;s:6:”height”;s: 3:”156″;}s:19:”trns-below_featured”;a:3:{s:4:”file”;s:21:”1_news_7525-70×70.jpg”;s:5:”width”;s:2:”70″;s:6:”height”;s:2:” 70″;}s:19:”trns-primary_midcol”;a:3:{s:4:”file”;s:21:”1_news_7525-60×45.jpg”;s:5:”width”;s:2:”60″;s:6:”height”;s:2:” 45″;}s:22:”trns-mainpage_photogal”;a:3:{s:4:”file”;s:23:”1_news_75 25-150×113.jpg”;s:5:”width”;s:3:”150″;s:6:”height”;s: 3:”113″;}s:22:”trns-primarybottomtabs”;a:3:{s:4:”file”;s:23:”1_news_75 25-269×201.jpg”;s:5:”width”;s:3:”269″;s:6:”height”;s: 3:”201″;}s:17:”trns-sbox_topleft”;a:3:{s:4:”file”;s:23:”1_news_7525-300×137.jpg”;s:5:”width”;s:3:”300″;s:6:”height”;s: 3:”137″;}s:18:”trns-sbox_topright”;a:3:{s:4:”file”;s:21:”1_news_7525-55×55.jpg”;s:5:”width”;s:2:”55″;s:6:”height”;s:2:” 55″;}s:18:”trns-sbox_botright”;a:3:{s:4:”file”;s:23:”1_news_7525-300×137.jpg”;s:5:”width”;s:3:”300″;s:6:”height”;s: 3:”137″;}s:17:”trns-sbox_botleft”;a:3:{s:4:”file”;s:21:”1_news_7525-55×55.jpg”;s:5:”width”;s:2:”55″;s:6:”height”;s:2:” 55″;}s:18:”trns-sidebar_posts”;a:3:{s:4:”file”;s:21:”1_news_7525-80×85.jpg”;s:5:”width”;s:2:”80″;s:6:”height”;s:2:” 85″;}s:12:”trns-archive”;a:3:{s:4:”file”;s:21:”1_news_7525-90×65.jpg”;s:5:”width”;s:2:”90″;s:6:”height”;s:2:” 65″;}s:18:”trns-archive_media”;a:3:{s:4:”file”;s:23:”1_news_7525-234×200.jpg”;s:5:”width”;s:3:”234″;s:6:”height”;s: 3:”200″;}}s:10:”image_meta”;a:10:{s:8:”aperture”;s :2:”29″;s:6:”credit”;s:0:””;s:6:”camera”;s:22:”Can on EOS-1Ds Mark III”;s:7:”caption”;s:0:””;s:17:”created_timestamp” ;s:10:”1228348733″;s:9:”copyright”;s:0:””;s:12:”fo cal_length”;s:2:”90″;s:3:”iso”;s:3:”100″;s:13:”shu tter_speed”;s:5:”0.005″;s:5:”title”;s:0:””;}}’),
    (2341, 1, ‘_edit_lock’, ‘1292520231’),
    (2342, 1, ‘_thumbnail_id’, ‘1126’);

    Does anyone know how I can do this as an automated task or does this mean I have to manually edit hundreds of posts simply to add an image?!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Alex-

    I am also running into this issue, as I try to manually create a WordPress XML file that automatically sets a featured image from an absolute URL (from my old blog). Did you ever figure this out?

    Thanks.

    -Nate

    well i was trying to import featured images into a theme that dealt with featured images in an odd way. i ended up shelving it and imported everything else but the images.

    if you find a solution it may be worth posting it up here… and good luck!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Import Featured Items with WordPress XML file’ is closed to new replies.