You many not need to edit the code. Put the file named cat.txt in your wp-content/themes/YourThemeName folder. That file should contain YOUR categories in a similar style to:
“category1″,””
“category2″,””
“cat1 subcat1″,”category1”
“cat1 subcat2″,”category1”
“cat2 subcat1″,”category2”
“cat2 subcat2″,”category2”
Thread Starter
jwack
(@jwack)
MichaelH – I have a couple quick questions.
- What happens if I add a sub-category that already exists?
- Back on your original post, where would I put the php that calls the text file?
- Lastly, this is compatible with 2.8.4?
Thanks very much!
1. I believe it overwrites the existing category with the new information. Remember subcats must be unique even if they have different parents
2. Could put it in a Page Template or in my case I just stuck it in my themes index.php, let it execute then deleted the code.
3. Seems to work with 2.8.4
4. Backup your database before attempting!
CSV 2 POST does this and you can do 3 levels