-
AuthorPosts
-
January 4, 2017 at 2:48 pm #729428
Hi Kriesi,
I would like to add a few new custom taxonomies, the same as the Portfolio Categories.
I added this code to my child theme functions.php, but that doens’t work:<?php
//hook into the init action and call create_book_taxonomies when it fires
add_action( ‘init’, ‘create_Plaatsen_hierarchical_taxonomy’, 0 );//create a custom taxonomy name it Plaatsen for your posts
function create_Plaatsen_hierarchical_taxonomy() {
// Add new taxonomy, make it hierarchical like categories
//first do the translations part for GUI$labels = array(
‘name’ => _x( ‘Plaatsen’, ‘taxonomy general name’ ),
‘singular_name’ => _x( ‘Plaats’, ‘taxonomy singular name’ ),
‘search_items’ => __( ‘Zoek plaatsen’ ),
‘all_items’ => __( ‘Alle plaatsen’ ),
‘parent_item’ => __( ‘Parent Plaats’ ),
‘parent_item_colon’ => __( ‘Parent Plaats:’ ),
‘edit_item’ => __( ‘Bewerk plaats’ ),
‘update_item’ => __( ‘Update Plaats’ ),
‘add_new_item’ => __( ‘Nieuwe plaats toevoegen’ ),
‘new_item_name’ => __( ‘Nieuwe plaatsnaam’ ),
‘menu_name’ => __( ‘Plaatsen’ ),
);// Now register the taxonomy
register_taxonomy(‘Plaatsen’,array(‘portfolio_entries’), array(
‘hierarchical’ => true,
‘labels’ => $labels,
‘show_ui’ => true,
‘show_admin_column’ => true,
‘query_var’ => true,
‘rewrite’ => array( ‘slug’ => ‘Plaats’ ),
));
}Am i forgetting something?
Kind regards
January 5, 2017 at 11:26 am #729810Fixed it!
I used ‘portfolio_entries’ to register the taxonomy. Had to be ‘portfolio’ in stead.
You can close this one.January 5, 2017 at 1:26 pm #729856Hi,
Glad you figured it out and thanks for sharing your solution! :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Regards,
Yigit -
AuthorPosts
- The topic ‘Add custom taxonomy for Portfolio item’ is closed to new replies.