カスタムタクソノミーのタームページ(一覧表示)の404エラーについて
-
壁にぶちあたってしまいましたので、ご教授頂けますと幸いです。
カスタム投稿にて、下記ページを作成しております。
・カスタム投稿ページ(http://xxx.com/blog)
・タームページ(http://xxx.com/blog/css)パーマリンクの設定にはCustom Post Type Permalinksを使い、
共通設定にはカスタム構造にチェックを入れ、
http://xxx.com/%category%/%year%%monthnum%%day%%hour%%minute%%second%.htmlという風に。
また、カスタム投稿タイプのパーマリンク設定エリアのblog欄には、
http://xxx.com/blog/%cat%/%year%%monthnum%%day%%hour%%minute%%second%.htmlという風にしております。また、本来、タームページ表示時にはカスタム分類名が表示されますが、
そこを切り取るコードをfunction.php内に書いております。(下記コード最下部)ソースはこちら
register_post_type( 'blog', array( 'label' => 'Blog', 'hierarchical' => false, 'query_var' => false, 'menu_position' => 25, 'has_archive' => true, 'rewrite' => array('slug' => 'blog'), 'public' => true, 'supports'=> array('title') ) ); register_taxonomy( 'cat', 'blog', array( 'hierarchical' => true, 'query_var' => true, 'rewrite' => true, 'update_count_callback' => '_update_post_term_count', 'label' => 'カテゴリー', 'singular_label' => 'カテゴリー', 'show_ui' => true ) ); flush_rewrite_rules( false ); //Add RewriteRule function my_custom_post_type_permalinks_set($termlink, $term, $taxonomy){ return str_replace('/'.$taxonomy.'/', '/', $termlink); } add_filter('term_link', 'my_custom_post_type_permalinks_set',11,3);
この状態でタームページへアクセスすると404ページに飛ばされてしまいます。
taxonomy.phpを読み込む用にするにはどのようにしたらいいでしょうか。
ご教授の程、よろしくお願いいたします。
10件の返信を表示中 - 1 - 10件目 (全10件中)
10件の返信を表示中 - 1 - 10件目 (全10件中)
- トピック「カスタムタクソノミーのタームページ(一覧表示)の404エラーについて」には新たに返信することはできません。