Title: aggressivex's Replies | WordPress.org

---

# aggressivex

  [  ](https://wordpress.org/support/users/aggressivex/)

 *   [Profile](https://wordpress.org/support/users/aggressivex/)
 *   [Topics Started](https://wordpress.org/support/users/aggressivex/topics/)
 *   [Replies Created](https://wordpress.org/support/users/aggressivex/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/aggressivex/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/aggressivex/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/aggressivex/engagements/)
 *   [Favorites](https://wordpress.org/support/users/aggressivex/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Custom Post Type Rewrite Permalink and Exclude base](https://wordpress.org/support/topic/custom-post-type-rewrite-permalink-and-exclude-base/)
 *  [aggressivex](https://wordpress.org/support/users/aggressivex/)
 * (@aggressivex)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/custom-post-type-rewrite-permalink-and-exclude-base/#post-1556407)
 * I had the same issue, I’ve solved it.
 * [http://wordpress.org/support/topic/how-can-i-create-a-custom-post-type-with-empty-slug?replies=3](http://wordpress.org/support/topic/how-can-i-create-a-custom-post-type-with-empty-slug?replies=3)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [How can I create a custom post type with empty slug?](https://wordpress.org/support/topic/how-can-i-create-a-custom-post-type-with-empty-slug/)
 *  Thread Starter [aggressivex](https://wordpress.org/support/users/aggressivex/)
 * (@aggressivex)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/how-can-i-create-a-custom-post-type-with-empty-slug/#post-1796850)
 * Thanks 🙂
 * I’ve solved it.
 * This works, but I had to re-update the permalinks config to see the effect.
 *     ```
       <?php
       /*
       Plugin Name: Aggressivex Network Custom Post
       Version: 1.0
       Author: Luis Muñoz
       Author URI: http://www.aggressivex.com/author/luis.munoz/
       */
       class AN_custom_post
       {
       	var $post_type_name		= 'product';
       	var $post_type_label 		= 'Products';
   
       	function __construct()
       	{
       		add_action('init', array(&$this,'register_post'));
       	}
   
       	function register_post()
       	{
       		register_post_type($this->post_type,
       			array(
       				'label'           => $this->post_type_label,
       				'public'          => true,
       				'show_ui'         => true,
       				'hierarchical'	  => true,
       				'rewrite'         => array(
       					'slug'		 	=> '',
       					'with_front'	=> true
       				),
       				'hierarchical'    => true,
       				'supports'        => array(
       					'title',
       					'editor',
       					'custom-fields'
       				),
       			)
       		);
       	}
       }
   
       new AN_custom_post();
       ```
   

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