Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #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

    #729810

    Fixed it!
    I used ‘portfolio_entries’ to register the taxonomy. Had to be ‘portfolio’ in stead.
    You can close this one.

    #729856

    Hi,

    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

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Add custom taxonomy for Portfolio item’ is closed to new replies.