masacube
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Bogo] カスタムタクソノミーのアーカイブページが表示されない色々と試してみたら解消しました。
しかしどれが有効だったのか明確では無いのでお役にたてないかと思いますが以下のような事をさまざま試しました。・「functions.php」から追加したカスタム投稿タイプの書き方を変更
・プラグイン「Rewrite ルールチェッカー」を導入し何度かリライトルールの「ルールをクリア」を実行
・「Custom Post Type Permalinks」にてパーマリンクを何度か変更上記などを様々試してみましたが、結果以下の流れで解消されていました。
1、「Rewrite ルールチェッカー」で「ルールをクリア」
2、パーマリンクを何もさわらず保存いったいどれが有効だったのか分かりませんが、以上のようなことで解消しました。お騒がせしました。
Forum: Plugins
In reply to: [Bogo] カスタムタクソノミーのアーカイブページが表示されないちなみにカスタム投稿は以下のように書いています。
どこか間違っていたりしますでしょうか・・・<?php function sample_products_custom_post_type(){ $labels = array( 'name' => _x('サンプルプロダクト', 'post type general name'), 'singular_name' => _x('サンプルプロダクト', 'post type singular name'), 'add_new' => _x('新規追加', 'sample_products'), 'add_new_item' => __('サンプルプロダクト'), 'edit_item' => __('編集'), 'new_item' => __('新規登録'), 'view_item' => __('表示'), 'search_items' => __('項目検索'), 'not_found' => __('記事が見つかりません'), 'not_found_in_trash' => __('ゴミ箱に記事はありません'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'has_archive' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-admin-tools', 'rewrite' => array( 'slug' => 'sample_products', "with_front" => true ), 'supports' => array('title','editor','thumbnail'), 'show_in_rest' => true, ); register_post_type('sample_products',$args); $args = array( 'label' => 'サンプルプロダクトカテゴリー', 'public' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_admin_column' => true, 'hierarchical' => true, 'has_archive' => true, 'query_var' => true, 'show_in_rest' => true, 'rewrite' => array( 'slug' => 'sample_products', 'with_front' => true ), ); register_taxonomy('sample_products_cat','sample_products',$args); $args = array( 'label' => 'サンプルプロダクトタグ', 'public' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_admin_column' => true, 'show_ui' => true, 'has_archive' => true, 'hierarchical' => false, 'query_var' => true, 'show_in_rest' => true, ); register_taxonomy('sample_products_tag','sample_products',$args); } add_action('init', 'sample_products_custom_post_type');
Viewing 2 replies - 1 through 2 (of 2 total)