Title: Add new post type
Last modified: August 21, 2016

---

# Add new post type

 *  Resolved [artotal](https://wordpress.org/support/users/artotal/)
 * (@artotal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/add-new-post-type/)
 * Hi,
    **– WordPress 3.6 : – PHP 5 / MySQL : – child theme of thirteen : – no extensions:–
   I use localhost :
 * **Problem :**
    I do a blog with different type of post with personelize ! I added
   in admin a new menu “recepies”. When I created a new recepies, I have a 404 error,
   why didn’t works ? this is my code :
 *     ```
       // Add new post type for Recipes
         4 add_action('init', 'cooking_recipes_init');
         5 function cooking_recipes_init()
         6 {
         7   $recipe_labels = array(
         8     'name' => _x('Recipes', 'post type general name'),
         9     'singular_name' => _x('Recipe', 'post type singular name'),
        10     'all_items' => __('All Recipes'),
        11     'add_new' => _x('Add new recipe', 'recipes'),
        12     'add_new_item' => __('Add new recipe'),
        13     'edit_item' => __('Edit recipe'),
        14     'new_item' => __('New recipe'),
        15     'view_item' => __('View recipe'),
        16     'search_items' => __('Search in recipes'),
        17     'not_found' =>  __('No recipes found'),
        18     'not_found_in_trash' => __('No recipes found in trash'),
        19     'parent_item_colon' => ''
        20   );
        21   $args = array(
        22     'labels' => $recipe_labels,
        23     'public' => true,
        24     'publicly_queryable' => true,
        25     'show_ui' => true,
        26     'query_var' => true,
        27     'rewrite' => true,
        28     'capability_type' => 'post',
        29     'hierarchical' => false,
        30     'menu_position' => null,
        31     'supports' => array('title','editor','comments')
        32   );
        33   register_post_type('recipes',$args);
        34 }
       ```
   
 * Thank you

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/add-new-post-type/#post-4162097)
 * If your site is already set up and you add a new post type like that your permalinks
   won’t have caught up wth the new addition. To get around this, go to the permalinks
   area in your admin and reset it by changing to ‘default’ and saving, and then
   back to your current setting and saving again. This will let your new post type
   show up correctly.
 *  Thread Starter [artotal](https://wordpress.org/support/users/artotal/)
 * (@artotal)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/add-new-post-type/#post-4162098)
 * Thanks, that’s works 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

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

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [artotal](https://wordpress.org/support/users/artotal/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/add-new-post-type/#post-4162098)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
