• snowbelly

    (@snowbelly)


    Loving the plug in, but I have one small problem with importing a custom taxonomy.

    My custom taxonomy is called “cemetery” and it is the name of a cemetery where a grave is located. I have used the header “tax_cemetery” for my CSV.

    My custom taxonomy is for a custom post type called “interment” and I’ve set up the custom taxonomy as a radio button choice in Advanced Custom Fields.

    When I run the import, it seems to work okay and when I view all the interments (custom type) as a list, I see the cemetery listed there.

    However, when I edit one of the newly imported interments, the cemetery radio button is not selected.

    Plus, when I view one of the newly created interments on the website, the cemetery is not there.

    What am I doing wrong?

    Here’s my CSV:

    tax_cemetery,section,row,plot,last_name,first_name,image_filename,footstone_image,date_of_death,hebrew_date_of_death,post_type,post_title,post_status
    Bank Street,1,8,24,Abelson,Sarah,IMG_Sec1_Row8_21.JPG,,19870508,21-Iyar-5747,interment,"Abelson, Sarah",publish
    Bank Street,1,8,25,Abelson,Mollie,IMG_Sec1_Row8_22.JPG,,19790510,13-Iyar-5739,interment,"Abelson, Mollie",publish

    https://www.ads-software.com/plugins/really-simple-csv-importer/

Viewing 1 replies (of 1 total)
  • Thread Starter snowbelly

    (@snowbelly)

    I got it to work! But it was complicated. If you’re working with Advanced Custom Fields as your custom field plugin, you’ll have to do a bit of tweaking to get the taxonomy import to work.

    First of all, when working with ACF you need to use the field name as the column titles, NOT the key/slug of the field as the column title. To get the field names, you can go into your ACF interface and view the custom field set for your post type. At the top, click “Screen Options” and click “Yes” to the Show Field Name box.

    This will put a field name next to each custom field that looks something like this: field_563b8971146de
    Use this code as your column name – so instead of using “first_name”, I should have been using field_563b8971146de.

    Now, if you have a custom taxonomy to import as well, you will need to do two things:
    * use the field name for that custom taxonomy as the column title (so instead of using tax_cemetery, I should have been using field_5638c60d70a9b as my column title)
    * In the column itself, you don’t want to use a text string or a slug for the value. Instead, what you need is the taxonomy code – i.e. its ID number in the database. To get this, you can: a) go to where your taxonomy values are defined (for me, this is in the “cemeteries” listing under my custom post type of “interments”); b) hover over the edit box for the taxonomy term in question; c) look at the link value in the browser footer for the tag_ID. Then go into your CSV and do a replace on the string with this number. For example, for me, the “Bank Street” value of the cemetery taxonomy was tag_ID 8, so I had to replace all the “Bank Street” values with just the number 8.

    And it worked!

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Taxonomy not showing up in ACF screen’ is closed to new replies.