hmbashar

Register Taxonomy

Dec 18th, 2015
160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     register_taxonomy(
  2.         'portfolio_category',  //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
  3.         'portfolios',                  //post type name
  4.         array(
  5.             'hierarchical'          => true,
  6.             'label'                         => 'Portfolio Category',  //Display name
  7.             'query_var'             => true,
  8.             'show_admin_column'             => true,
  9.             'rewrite'                       => array(
  10.                 'slug'                  => 'Portfolio-category', // This controls the base slug that will display before each term
  11.                 'with_front'    => true // Don't display the category base before
  12.                 )
  13.             )
  14.     );
  15.     register_taxonomy(
  16.         'portfolio_menu',  //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
  17.         'portfolios',                  //post type name
  18.         array(
  19.             'hierarchical'          => true,
  20.             'label'                         => 'Portfolio Menus',  //Display name
  21.             'query_var'             => true,
  22.             'show_admin_column'             => true,
  23.             'rewrite'                       => array(
  24.                 'slug'                  => 'itams', // This controls the base slug that will display before each term
  25.                 'with_front'    => true // Don't display the category base before
  26.                 )
  27.             )
  28.     );
RAW Paste Data