I am creating a custom taxonomy but having some errors. Need help

Home Forums Welcome! Pre-Sales Questions I am creating a custom taxonomy but having some errors. Need help

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1410649
    Alexander
    Guest

    I have been adding the code in functions.php but still i am having some errors as i don’t know what i have done wrong. I have seen the code from https://www.wpblog.com/create-custom-taxonomies-in-wordpress/

    add_action( 'init', 'create_cw_hierarchical_taxonomy', 0 );
    //create a custom taxonomy name
    function create_cw_hierarchical_taxonomy() {
    $labels = array(
    'name' => _x( 'Topics', 'taxonomy general name' ),
    'singular_name' => _x( 'Topic', 'taxonomy singular name' ),
    'search_items' => __( 'Search Topics' ),
    'all_items' => __( 'All Topics' ),
    'parent_item' => __( 'Parent Topic' ),
    'parent_item_colon' => __( 'Parent Topic:' ),
    'edit_item' => __( 'Edit Topic' ),
    'update_item' => __( 'Update Topic' ),
    'add_new_item' => __( 'Add New Topic' ),
    'new_item_name' => __( 'New Topic Name' ),
    'menu_name' => __( 'Topics' ),
    );
    // taxonomy register
    register_taxonomy('topics',array('post'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'topic' ),
    ));
    }

    #1411330
    Crisoforo
    Keymaster

    Hey there.

    Thanks for reach out. Unfurtunatelly this question is related about WordPress taxonomies. We can give you some guidance and support here for any of our plugins and related.

    You might be able to find more about this in the WordPress Forums, but looks like you need to add the code in your file called: functions.php. 

     

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘I am creating a custom taxonomy but having some errors. Need help’ is closed to new replies.