• Resolved Ian

    (@ianaleksander)


    For some reason, I can’t seem to get posts to upload with custom taxonomies intact.

    I get the errors:
    Unknown taxonomy (Edition)

    Unknown taxonomy (Creator)

    Unknown taxonomy (Series/Event)

    The taxonomies work fine throughout the rest of the site, and everything else imports perfectly, including custom post types, custom fields, etc.

    This is the code I’m using to do the post types in the functions:

    add_action( 'init', 'create_my_taxonomies', 0 );
    
    function create_my_taxonomies() {
    
    register_taxonomy( 'creator', 'post', array( 'hierarchical' => false, 'label' => 'Creator', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'edition', 'post', array( 'hierarchical' => false, 'label' => 'Edition', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'series', 'post', array( 'hierarchical' => false, 'label' => 'Series/Event', 'query_var' => true, 'rewrite' => true ) );
    
    register_taxonomy( 'dc-series', 'DC', array( 'hierarchical' => false, 'label' => 'DC Series/Event', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'wildstorm-series', 'Wildstorm', array( 'hierarchical' => false, 'label' => 'Wildstorm Series/Event', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'marvel-series', 'Marvel', array( 'hierarchical' => false, 'label' => 'Marvel Series/Event', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'image-series', 'Image', array( 'hierarchical' => false, 'label' => 'Image Series/Event', 'query_var' => true, 'rewrite' => true ) );
    
    register_taxonomy( 'dc-character', 'DC', array( 'hierarchical' => false, 'label' => 'DC Comics Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'wildstorm-character', 'Wildstorm', array( 'hierarchical' => false, 'label' => 'Wildstorm Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'marvel-character', 'Marvel', array( 'hierarchical' => false, 'label' => 'Marvel Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'ultimate-marvel-character', 'Ultimate-Marvel', array( 'hierarchical' => false, 'label' => 'Ultimate Marvel Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'image-character', 'Image', array( 'hierarchical' => false, 'label' => 'Image Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'buffyverse-character', 'Buffyverse', array( 'hierarchical' => false, 'label' => 'Buffyverse Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'hellboy-character', 'Hellboy-Universe', array( 'hierarchical' => false, 'label' => 'Hellboy Universe Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'americas-best-character', 'Americas-Best', array( 'hierarchical' => false, 'label' => 'Americas Best Comics Character', 'query_var' => true, 'rewrite' => true ) );
    register_taxonomy( 'fables-character', 'Fables', array( 'hierarchical' => false, 'label' => 'Fables Character', 'query_var' => true, 'rewrite' => true ) );
    }

    It all seems right to me, but maybe I’m missing something stupid?

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

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter Ian

    (@ianaleksander)

    it also doesn’t work for just using the slugs, which I tried first:

    Unknown taxonomy (edition)

    Unknown taxonomy (creator)

    Unknown taxonomy (series)

    Plugin Contributor dvkob

    (@dvkob)

    ianaleksander: May I see the file you’re trying to import?

    Thread Starter Ian

    (@ianaleksander)

    Plugin Contributor dvkob

    (@dvkob)

    ianaleksander: Works for me. Below is the code I used in my functions.php. It just adds register_post_type stuff to your code.

    add_action( 'init', 'create_my_taxonomies', 0 );
    
    function create_my_taxonomies() {
        register_post_type('DC', array('public' => true, 'label' => 'DC'));
        register_post_type('Marvel', array('public' => true, 'label' => 'Marvel'));
        register_post_type('Image', array('public' => true, 'label' => 'Image'));
        register_post_type('Wildstorm', array('public' => true, 'label' => 'Wildstorm'));
        register_post_type('Ultimate-Marvel', array('public' => true, 'label' => 'Ultimate-Marvel'));
        register_post_type('Buffyverse', array('public' => true, 'label' => 'Buffyverse'));
        register_post_type('Hellboy-Universe', array('public' => true, 'label' => 'Hellboy-Universe'));
        register_post_type('Americas-Best', array('public' => true, 'label' => 'Americas-Best'));
        register_post_type('Fables', array('public' => true, 'label' => 'Fables'));
    
        register_taxonomy( 'creator', 'post', array( 'hierarchical' => false, 'label' => 'Creator', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'edition', 'post', array( 'hierarchical' => false, 'label' => 'Edition', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'series', 'post', array( 'hierarchical' => false, 'label' => 'Series/Event', 'query_var' => true, 'rewrite' => true ) );
    
        register_taxonomy( 'dc-series', 'DC', array( 'hierarchical' => false, 'label' => 'DC Series/Event', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'wildstorm-series', 'Wildstorm', array( 'hierarchical' => false, 'label' => 'Wildstorm Series/Event', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'marvel-series', 'Marvel', array( 'hierarchical' => false, 'label' => 'Marvel Series/Event', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'image-series', 'Image', array( 'hierarchical' => false, 'label' => 'Image Series/Event', 'query_var' => true, 'rewrite' => true ) );
    
        register_taxonomy( 'dc-character', 'DC', array( 'hierarchical' => false, 'label' => 'DC Comics Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'wildstorm-character', 'Wildstorm', array( 'hierarchical' => false, 'label' => 'Wildstorm Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'marvel-character', 'Marvel', array( 'hierarchical' => false, 'label' => 'Marvel Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'ultimate-marvel-character', 'Ultimate-Marvel', array( 'hierarchical' => false, 'label' => 'Ultimate Marvel Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'image-character', 'Image', array( 'hierarchical' => false, 'label' => 'Image Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'buffyverse-character', 'Buffyverse', array( 'hierarchical' => false, 'label' => 'Buffyverse Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'hellboy-character', 'Hellboy-Universe', array( 'hierarchical' => false, 'label' => 'Hellboy Universe Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'americas-best-character', 'Americas-Best', array( 'hierarchical' => false, 'label' => 'Americas Best Comics Character', 'query_var' => true, 'rewrite' => true ) );
        register_taxonomy( 'fables-character', 'Fables', array( 'hierarchical' => false, 'label' => 'Fables Character', 'query_var' => true, 'rewrite' => true ) );
    }

    I don’t see any taxonomy fields in your file, though.

    Thread Starter Ian

    (@ianaleksander)

    oh sorry, I totally posted the wrong one. that one has the taxonomy stuff trimmed since it wasn’t working.

    https://www.tradereadingorder.com/temp/test.csv

    here’s the file with the taxonomies. Just tested it, and edition, creator, and series give the error.

    thanks so much for your help, by the way!

    headway

    (@headway)

    Any resolution to this? I’m having a similar issue, can’t get data into a custom taxonomy.

    headway

    (@headway)

    @ianaleksander – While trying to fix my issue I think I found your problem. The column header you have declared for your hierarchical custom taxonomy is csv_ctax_(edition). Simply remove the parenthesis. The header should look like this csv_ctax_edition.

    Hope this helps with your errors.

    Thread Starter Ian

    (@ianaleksander)

    Oh wow, that is such an amazingly simple solution. If this works, you’ve pretty much saved my life.

    Thread Starter Ian

    (@ianaleksander)

    Oh it totally worked! Thank you so much. Absolutely awesome.

    Plugin Contributor dvkob

    (@dvkob)

    headway: ianaleksander: Glad you worked it out. It’s nice to see people in the community helping each other out. Taxonomy syntax is a bit tricky, but I don’t think there’s an easier way to use custom taxonomies from a CSV file.

    Thread Starter Ian

    (@ianaleksander)

    It’s been really great since then – this whole plugin has been a godsend. Absolutely essential to my workflow right now.

    hi guy’s
    Im having the same trouble but its not working for me.

    I read in another post that CSV Importer doesnt work with Custom Taxonomies if they are Herarchical.

    Is it true?
    Because what i did is

    add_action('init', 'create_producto');
    	function create_producto() {
        	$producto_args = array(
            	'label' => __('Producto'),
            	'singular_label' => __('Producto'),
            	'public' => true,
            	'show_ui' => true,
            	'capability_type' => 'post',
            	'hierarchical' => false,
            	'rewrite' => true,
            	'supports' => array('title', 'editor', 'thumbnail')
            );
        	register_post_type('producto',$producto_args);
    	}

    and

    register_taxonomy("catalog", array("producto"), array("hierarchical" => true, "label" => "Catalogs", "singular_label" => "Catalog", "rewrite" => true));

    and my .csv file goes like this

    csv_post_title,csv_post_post,csv_post_typ,csv_ctax_catalog

    If that is the case and is not that im doing something wrong… can somebody let me know if there is another CSV Import Plugin around that works better?

    Thx everybody

    forget it guy’s… this is what happend when we dont read the manuals. ??

    they say:

    __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).

    Sample custom-taxonomies.csv file included with the plugin illustrates custom taxonomy support.

    Hi,

    I’m struggling with a taxonomy import problem.
    All works well with posts, categories, tags etc, even taxonomy tags are working (created and inserted).
    But with taxonomy categories I have a problem: categories are being created but not chosen for the post. Why?

    Anyone?

    Thanks,

    Knokenet

    Plugin Contributor dvkob

    (@dvkob)

    knokenet: Are you sure that the categories are not chosen for the post? By default, WordPress displays hierarchical categories a post belongs to somewhat unintuitively. There might have been a related topic on the forums in the past…

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: CSV Importer] Custom Taxonomies Import not working’ is closed to new replies.