0

i made custom taxonomy for woocomerce products, products will be books and ecery book have his own writter.

<pre>function custom_taxonomy_writter() {
    $labels = array(
        'name' => 'Writters',
        'singular_name' => 'Writter',
        'menu_name' => 'Writter',
        'all_items' => 'All writters',
        'parent_item' => 'Parent writter',
        'parent_item_colon' => 'Parent writter:',
        'new_item_name' => 'New writter name',
        'add_new_item' => 'Add new writter',
        'edit_item' => 'Edit writter',
        'update_item' => 'Update writter',
        'separate_items_with_commas' => 'Separate writter with commas',
        'search_items' => 'Search writters',
        'add_or_remove_items' => 'Add or remove writters',
        'choose_from_most_used' => 'Choose from the most used writters',
    );
    $args = array(
        'labels' => $labels,
        'hierarchical' => true,
        'public' => true,
        'show_ui' => true,
        'show_admin_column' => true,
        'show_in_nav_menus' => true,
        'show_tagcloud' => true,
    );
    register_taxonomy('writter', 'product', $args);
}

add_action('init', 'custom_taxonomy_writter', 0);</pre>


Screenshoot from wp admin:

enter image description here



Now I need to display it for example under the product title, and needs to bi link, like tags or categories.

enter image description here

1
  • FYI: Assuming your target audience speaks English, it's spelt "writer", not "writter".
    – bacar
    Sep 3, 2014 at 9:35

1 Answer 1

0

Wooola!

<?php echo get_the_term_list( $post->ID, 'writter', '', ', ' ); ?>

Simple and works!!! And is also linked to author with listing of his books :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.