WordPress.org

Ready to get started?Download WordPress

Forums

CSV Importer
Custom Taxonomies not importing (6 posts)

  1. DGWordPressUser
    Member
    Posted 3 years ago #

    I have read the other threads in here and still cant get custom taxonomies to import.

    In the readme.txt file it says Top level terms have to be preceded
    either by an empty string or a 0 (zero). But there is no example of this in the custom-taxonomies.csv file.

    I had trouble with excel outputting quotes, but then I tried outputting it from Access instead, which gave me the quotes, but still no luck.

    I have tried adding zeros before the term like: "0, Aged Care / Health" but this had no affect either.

    The only difference I see is that the sample file uses "post" where I am trying to import into "projects" which is my custom post type.

    if (!is_taxonomy('sector')) {
    		register_taxonomy(
    		'sector', array('project', 'client'), array(
    		'hierarchical' => true,
    		'label' => 'Sector',
    		'query_var' => true,
    		'rewrite' => array( 'slug' => 'sector' ),/* !any permalink url must be unique */
    		'with_front' => false
    		) );
    
    		wp_insert_term('Aged Care / Health', 'sector');

    "csv_post_type","csv_ctax_sector","csv_ctax_client_type","csv_post_title","csv_post_post","referee_name","shortDescription"

    If any one has any ideas, it would be appreciated.

  2. tzeldin88
    Member
    Posted 3 years ago #

    It works for me (though the documentation is a bit light). In your example
    "0, Aged Care / Health"
    there is a Space after the Comma, as well as a Slash in the taxonomy term. Perhaps either of these are causing the problem?

  3. boonofdoom
    Member
    Posted 3 years ago #

    I agree with the people saying that the documentation on how to import to a hierarchical custom taxonomy could be clearer. Here's what it says in the readme:

    __Hierarchical taxonomies__

    The syntax for hierarchical taxonomies is more complicated. Each hierarchical
    taxonomy field is a tiny two-column CSV file, where _the order of columns
    matters_. The first column contains the name of the parent term and the second
    column contains the name of the child term. Top level terms have to be preceded
    either by an empty string or a 0 (zero).

    This makes it sound to me like there needs to be a separate CSV file with only two columns in it, but this second CSV file isn't mentioned anywhere else, so I don't think I understand. Here are the contents of the only relevant column in the example file custom-taxonomies.csv:

    csv_ctax_art
    Painting, post-impressionism
    Painting, impressionism
    Painting, cubism
    Sculpture, cubism
    Poetry, aestheticism
    Prose, "fiction, gothic"

    Where does the empty string or zero go? What do the line breaks in the 4th and 5th row signify? I think maybe the "tiny, two-column CSV file" the directions are referring to is the contents of those 4th and 5th rows, and the line break is meant to be a break between fields?

  4. dvkob
    Member
    Plugin Author

    Posted 3 years ago #

    boonofdoom: When I added support for custom taxonomies, I didn't envision it as such a popular feature, hence the lacking documentation. You did get everything right though.

    The "tiny, two-column CSV file" in the directions are referring to the contents of rows 4 and 5, and the line break is meant to be a break between fields. The empty string or zero can be used as follows:

    csv_ctax_art
    Painting, post-impressionism
    0,Painting
  5. joshuef
    Member
    Posted 2 years ago #

    Can anyone clarify this please. It's still really unclear.

    Say I have a taxonomy for videogames:

    Console
    -PS3
    -Xbox 360

    Mobile
    -Nintendo DS
    -iPhone

    What do I need in my csv file to put a game in the Console, PS3, Xbox and Mobile, Nintendo DS taxs. I've tried various combinations of:

    0,Console, Xbox 360, PS3
    0,Console, Xbox 360, 0,Console, PS3

    And so on, but nothing seems to work.

  6. Rutwick Gangurde
    Member
    Posted 2 years ago #

    @tzeldin88
    You rock man! Thanks a lot, your solution worked! That line in the doc doesn't really go to my head, and the custom taxonomies csv shipped along with the plugin too doesn't work! They should really change the example csv and the documentation.

    - Rutwick

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic