次のものでレンガの壁を打つ:
私が持っています:
- 1つのカスタム投稿タイプが呼び出されました cpt_community
- 1つのカスタム分類が呼び出されました tax_community
'rewrite' => trueCPT登録で設定した場合、このCPTのエントリへのパーマリンクはの形式http://<domain>/cpt_community/test_item/になり、参照すると404が表示されます。
私が設定した   'rewrite' => false場合、パーマリンクはhttp://<domain>/?cpt_community=test_item/であり、これは正常に機能します。
だから、私は明らかに何か間違っている/愚かなことをしています-問題は、何ですか?
[更新]
- すべての変更後、[設定]> [パーマリンク]に移動して(そして保存して)ルールをフラッシュします
- すべてを1時間放置した後、物事は正常に機能し始めました-それでなぜ遅れているのですか?
コード
CPT登録
function community_post_type() {
  $labels = array('name'  => 'Community');
   $args = array(
      'labels' => $labels,
      'public' => true,
      'publicly_queryable' => true,
      'show_ui' => true,
      'show_in_menu' => true,
      'query_var' => true,
      'rewrite' => false,
      'capability_type' => 'post',
      'has_archive' => true,
      'hierarchical' => false,
      'menu_position' => null,
      'has_archive' => true,
      'supports' => array('title','editor','excerpt','custom-fields','comments','revisions','thumbnail','author','page-attributes')
   ); 
  register_post_type('cpt_community', $args);
}  
add_action( 'init', 'community_post_type' );カスタム分類の登録
function community_tax_type() {
  register_taxonomy(
    'tax_community',
    'cpt_community',
     array( 'hierarchical' => false,
       'label' => 'Community Content Type',
       'show_ui' => true,'query_var' => true,
       'rewrite' => true,
       'singular_label' => 'Community Content Type',
       'capabilities' => array('assign_terms' => 'edit_community_tags')
       )
   );
   # allow roles to add community taxonomy tags to a community CPT
   $roles = array("subscriber","contributor","author","editor","administrator");
   foreach ($roles as $role_name) {
     $role = get_role($role_name);
     $role->add_cap("edit_community_tags");
   }   
}
add_action( 'init', 'community_tax_type' );
                
                1
              
                  パーマリンクのページにアクセスして保存することで、最初に書き換えをフラッシュしましたか?
                
                
                  
                    —
                    ミロ
                    
                  
                
              
                  @milo-うん。興味深いことに、1時間離れてから戻ってきた後、「かなりのパーマリンク」が機能するようになりました-質問を更新して、「なぜ遅延するのか」としてフレーム化します
                
                
                  
                    —
                    anu 
                    
                  
                
              
                  キャッシュプラグインを使用していますか?他のすべてのプラグインを無効にすると、より速く動作しますか?(通常の容疑者を邪魔にならないようにするだけ)
                
                
                  
                    —
                    Jan Fabry 
                    
                  
                
              
                  @jan-キャッシュプラグインなし。問題は、この動作を再現できないことです。これは数回発生し、その後消えますが、実際に修正するための特定のアクション(私が知ることができる)はありません。
                
                
                  
                    —
                    anu