Title: Custom post type permalink
Last modified: August 19, 2016

---

# Custom post type permalink

 *  [seyha](https://wordpress.org/support/users/seyha/)
 * (@seyha)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-permalink/)
 * Dear All,
 * I am a new programmer with WordPress. I try to create custom post type
    with 
   my project. My problem is I want to get the slug of eahc category of the catalog:
   If any one know about this please help me.
 * Thanks In advances!
 * The code I used like this:
 * add_action(‘init’, ‘product_register’);
    function product_register(){ $args =
   array( ‘label’ => __(‘Products’), ‘singular_label’ => __(‘Product’), ‘public’
   => true, ‘show_ui’ => true, ‘capability_type’ => ‘post’, ‘hierarchical’ => false,‘
   rewrite’ => true, //’permalink_epmask’=>’EP_PERMALINK ‘, ‘rewrite’ => array( ‘
   slug’ => ‘product’, ‘with_front’ => true), //Rewrite for singular product ‘supports’
   => array(‘title’, ‘editor’, ‘thumbnail’, ‘custom-fields’) ); register_post_type(‘
   product’ , $args ); } ?> <?php add_action(“admin_init”, “admin_init”); add_action(‘
   save_post’, ‘save_price’);
 *  function admin_init(){
    add_meta_box(“prodInfo-meta”, “Product Options”, “meta_options”,“
   product”, “side”, “low”); }
 *  function meta_options(){
    global $post; $custom = get_post_custom($post->ID);
   $price = $custom[“price”][0]; ?> <label>Price:</label><input name=”price” value
   =”<?php echo $price; ?>” /> <?php //End 0f Product Optoins ?> <?php }
 * function save_price(){
    global $post; update_post_meta($post->ID, “price”, $_POST[“
   price”]); }
 * register_taxonomy(“catalog”, array(“product”), array(“hierarchical” => true, “
   label” => “Catalogs”, “singular_label” => “Catalog”, “rewrite” => true));
    ?>
   <?php add_filter(“manage_edit-product_columns”, “prod_edit_columns”); add_action(“
   manage_posts_custom_column”, “prod_custom_columns”);
 * function prod_edit_columns($columns){
    $columns = array( “cb” => “<input type
   =\”checkbox\” />”, “title” => “Product Title”, “description” => “Description”,“
   price” => “Price”, “catalog” => “Catalog”, );
 *  return $columns;
    }
 * function prod_custom_columns($column){
    global $post; switch ($column) { case“
   description”: the_excerpt(); break; case “price”: $custom = get_post_custom();
   echo $custom[“price”][0]; break; case “catalog”: echo get_the_term_list($post-
   >ID, ‘catalog’, ”, ‘, ‘,”); break; } } add_action(‘init’, ‘flush_rewrite_rules’);//
   Mod_Rewrite ?>

The topic ‘Custom post type permalink’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [seyha](https://wordpress.org/support/users/seyha/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-permalink/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
