<?php 

function create_vidall_portfolio() 
{
  $labels = array(
    'name' => _x('Portfolio', 'portfolio'),
    'singular_name' => _x('Portfolio', 'portfolio'),
    'add_new' => _x('Add New', 'portfolio'),
    'add_new_item' => __('Add New Portfolio Item'),
    'edit_item' => __('Edit Item'),
    'new_item' => __('New Item'),
    'view_item' => __('View Item'),
    'search_items' => __('Search Items'),
    'not_found' =>  __('No items found'),
    'not_found_in_trash' => __('No items found in Trash'), 
    'parent_item_colon' => ''
  );
  $args = array(
    'labels' => $labels,
    'public' => true,
    'show_ui' => true, 
    'query_var' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'menu_position' => 30,
    'menu_icon' => 'dashicons-portfolio',
    'supports' => array('title','editor','thumbnail')
  ); 
  register_post_type('portfolio',$args);
}
add_action('init', 'create_vidall_portfolio');

function categoriesTaxonomy()
{
  register_taxonomy( "portfolio-categories", 
  array(  "portfolio" ), 
  array(  "hierarchical" => true,
      "labels" => array('name'=>"Filter item name",'add_new_item'=>"Add New Field"), 
      "singular_label" => __( "Field" ), 
      "rewrite" => array( 'slug' => 'fields', // This controls the base slug that will display before each term 
              'with_front' => false)
     ) 
  );
}
add_action('init', 'categoriesTaxonomy');