WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Three Custom post Types and one Custom Taxonomy and some pages. The Custom taxonomy is register with one of the post type. The problem is When the default Permalink is enable it works for all pages, custom post types and taxonomies. But when the "Post name" or any other permalink enable it breaks the pages structure, and the rest of links are working fine.

After Register the post types and taxonomies i use flush_rewrite_rules() but its not working.

Please help me in this situation.

function rg_menus(){
        'header'=> "Primary Menu",
        'footer'=> "Footer Menu",
        'header_menu'=>'Top Menu'



/* P-Riopel Product */  
function create_product(){
   register_post_type('priopel_products', array(    'label' => 'PRiopel Products','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => 'product'),'query_var' => true,'has_archive' => true,'exclude_from_search' => false,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','thumbnail','author','page-attributes',),'taxonomies' => array('priopel_cat',),'labels' => array (
  'name' => 'PRiopel Products',
  'singular_name' => 'PRiopel Product',
  'menu_name' => 'PRiopel Products',
  'add_new' => 'Add Product',
  'add_new_item' => 'Add New Product',
  'edit' => 'Edit',
  'edit_item' => 'Edit Product',
  'new_item' => 'New Product',
  'view' => 'View Product',
  'view_item' => 'View Product',
  'search_items' => 'Search Products',
  'not_found' => 'No Products Found',
  'not_found_in_trash' => 'No Products Found in Trash',
  'parent' => 'Parent Product',
),) );  
/* P-Riopel Product Category */     
function create_product_category(){
      array ('priopel_products',
                    ),array( 'hierarchical' => true, 
                             'public' => true,  
                             'label' => 'Categories',
                             'show_ui' => true,
                             'query_var' => true,
                             'rewrite' => array('slug' => '','with_front' => true,'hierarchical'=>true),
                             'singular_label' => 'Category') );
share|improve this question
Please add some code snippets to demonstrate how you are registering your custom post types and taxes. – Brian Fegter Sep 14 '12 at 3:41
Thank you for your response on my question. Please view the link to see the code. mksols.com/code_snippet.txt. I actually figure out that when i tried to register the my custom taxonomy to the custom post type it creates problem for the permalink. – user19694 Sep 15 '12 at 4:57

after_setup_theme is the wrong action to register post types. See register_post_type in Codex:

Do not use register_post_type before init.

share|improve this answer
No Brian Its not working :(. Still Page Not Found Error. As you told me that not to use after_setup_theme hook to register the custom post type. I wrote the code under "init" hook, and re-save the permalinks. I have updated my recent code to above link in code_snippet.txt file kindly check it again. – user19694 Sep 17 '12 at 7:59
your product category rewrite slug should not be empty, also don't flush rewrite rules on every request – Milo Sep 17 '12 at 14:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.