Title: Custom Post Types not working
Last modified: August 20, 2016

---

# Custom Post Types not working

 *  [tjobbe](https://wordpress.org/support/users/tjobbe/)
 * (@tjobbe)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-types-not-working-2/)
 * I have added some code to my functions file and uploaded it to my server, and
   I can now see the appropriate post type in my left hand bar in the admin area,
   and I’m able to add posts to it – but I’m unable to view them!
 * When I click them I get my 404 page, but the URL looks correct.
 * Here is the code I’ve been using:
 *     ```
       //custom post type
   
       add_action( 'init', 'create_post_type' );
       function create_post_type() {
       	register_post_type( 'test_product',
       		array(
       			'labels' => array(
       				'name' => __( 'Test' ),
       				'singular_name' => __( 'Test' )
       			),
       			'public' => true,
       			'has_archive' => true,
       			'rewrite' => array('slug' => 'test'),
       		)
       	);
       }
       ```
   

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-types-not-working-2/#post-3384560)
 * Try re-saving your permalinks in wp-admin > Settings > Permalinks.
 *  Thread Starter [tjobbe](https://wordpress.org/support/users/tjobbe/)
 * (@tjobbe)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-types-not-working-2/#post-3384562)
 * Thanks!

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

The topic ‘Custom Post Types not working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [tjobbe](https://wordpress.org/support/users/tjobbe/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/custom-post-types-not-working-2/#post-3384562)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
