カスタム投稿のカテゴリー別一覧
-
お世話になっております。
今、カスタム投稿内のカテゴリー別の一覧を表示したく、試行錯誤しています。
functions.php
function hoge_custom_post_type() {
$labels = array(
‘name’ => ‘カスタム投稿名’,
‘singular_name’ => ‘カスタム投稿名’,
‘add_new_item’ => ‘カスタム投稿名を追加’,
‘add_new’ => ‘新規追加’,
‘new_item’ => ‘新規カスタム投稿名’,
‘view_item’ => ‘カスタム投稿名を表示’,
‘not_found’ => ‘カスタム投稿名は見つかりませんでした’,
‘not_found_in_trash’ => ‘ゴミ箱にカスタム投稿名はありません’,
‘search_items’ => ‘カスタム投稿名を検索’,
);
$args = array(
‘labels’ => $labels,
‘public’ => true,
‘show_ui’ => true,
‘query_var’ => true,
‘hierarchical’ => true,
‘menu_position’ => 5,
‘supports’ => array(‘title’,’editor’,’author’,’thumbnail’,’page-attributes’),
‘capability_type’ => ‘page’,
‘has_archive’ => true
);
register_post_type(‘hoge’, $args);$args = array(
‘label’ => ‘カテゴリー’,
‘public’ => true,
‘show_ui’ => true,
‘hierarchical’ => true );register_taxonomy(‘hoge_category’,’hoge’,$args);
$args = array(
‘label’ => ‘タグ’,
‘public’ => true,
‘show_ui’ => true,
‘hierarchical’ => true );register_taxonomy(‘hoge_tag’,’hoge’,$args);
flush_rewrite_rules( false );}
add_action(‘init’, ‘hoge_custom_post_type’);で、カスタム投稿を使えるようにしています。
http://xxx.jp/hoge/カスタム投稿のタクソノミー名/
でカスタム投稿のタクソノミー内の一覧を表示したいのですが、
404.phpが読み込まれてしまいます。パーマリンクはカスタム構造/%category%/%postname%/。
Custom Post Type Permalinksというプラグインを使用しており、
このカスタム投稿のパーマリンクは/%postname%/となっています。どなたかご存じの方はご指導いただければと思います。
よろしくお願いします。
- トピック「カスタム投稿のカテゴリー別一覧」には新たに返信することはできません。