Custom post type, permalinks, taxonomies and blog posts

I would do as @cfx suggested:

register_taxonomy( // Call before register_post_type() to give rewrite rule priority.
    'bike_category', // Should be singular, not bikes_category
    'bike',
    array(
        'rewrite' => array(
            'with_front' => false, // This will strip the "blog" prefix 
            'slug' => 'bikes',
        ),

        // Other args
    )   
);

register_post_type(
    'bike', // Post type should be singular
    array(
        'has_archive' => 'bikes',
        'rewrite' => array(
            'with_front' => false, // This will strip the "blog" prefix 
            'slug' => 'bike',
        ),

        // Other args
    )
);

This will give you:

  • /bikes/ for global bikes archive (archive-bike.php)
  • /bikes/category for a bikes category archive (taxonomy-bike_category.php)
  • /bike/bike-name for a single bike (single-bike.php)

tech