Support » Fixing WordPress » Importing Posts into a specific category?

  • Hi, all!

    I did a search for this topic already, and didn’t find anything, so my apologies if I missed it and am asking an already answered question!

    I’m currently importing posts from my livejournal, and would like to have them in a separate category (other than “General”, which is the default it seems). Is there a way in the import-livejournal.php file to specify what category they should be listed in, or will I just need to edit each post by hand after the import?

    Thanks, in advance for any assistance!

    Mary

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rhiamon

    (@rhiamon)

    How sad is it to answer your own question? LOL! Still, I’m doing it anyway, in case it’s of use to others!

    Under “else :” edit these two lines:

    $exists = $wpdb->get_row(“SELECT * FROM $tablepost2cat WHERE post_id = $post_id AND category_id = 1”);

    and

    if (!$exists) $wpdb->query(“INSERT INTO $tablepost2cat (post_id, category_id) VALUES ($post_id, 1) “);

    It’s the last part of each line that wants editing: in the first line, “category_id=1”, change the number to the number of the specific category you wish the post to be filed under (ie 2 or 3 or 84, or whatever). Do the same in the “$post_id, 1” field on the second line.

    I’m a code-idiot, so your answer is confusing to me.

    I want to import from a Blogger account into a certain category in my WP blog. Can I get some more step-by-step assistance please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Importing Posts into a specific category?’ is closed to new replies.