Bài đăng

Đang hiển thị bài đăng từ Tháng 2, 2014

Manually Creating Custom Taxonomies

Manually Creating Custom Taxonomies ( tao the loai tuy chinh) Add the following code in your theme’s  functions.php  file or in a  site-specific plugin  (recommended)  to create a hierarchical custom taxonomy like categories: //hook into the init action and call create_book_taxonomies when it fires add_action( 'init', 'create_topics_hierarchical_taxonomy', 0 ); //create a custom taxonomy name it topics for your posts function create_topics_hierarchical_taxonomy() { // Add new taxonomy, make it hierarchical like categories //first do the translations part for GUI $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' =&