wordpressの質問です。
https://www.smashingmagazine.com/2012/11/complete-guide-custom-post-types/
このサイトを参考にfunctions.phpの最後に
php
1//カスタム投稿タイプ 2function my_custom_post_product() { 3 $labels = array( 4 'name' => _x( 'Products', 'post type general name' ), 5 'singular_name' => _x( 'Product', 'post type singular name' ), 6 'add_new' => _x( 'Add New', 'book' ), 7 'add_new_item' => __( 'Add New Product' ), 8 'edit_item' => __( 'Edit Product' ), 9 'new_item' => __( 'New Product' ), 10 'all_items' => __( 'All Products' ), 11 'view_item' => __( 'View Product' ), 12 'search_items' => __( 'Search Products' ), 13 'not_found' => __( 'No products found' ), 14 'not_found_in_trash' => __( 'No products found in the Trash' ), 15 'parent_item_colon' => '', 16 'menu_name' => 'Products' 17 ); 18 $args = array( 19 'labels' => $labels, 20 'description' => 'Holds our products and product specific data', 21 'public' => true, 22 'menu_position' => 5, 23 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ), 24 'has_archive' => true, 25 ); 26 register_post_type( 'product', $args ); 27} 28add_action( 'init', 'my_custom_post_product' );
これを追加してみました。ダッシュボードにproductの項目が追加されたのはいいのですが、addnewから、適当にページを作成して、更新を押して、そのページに飛んでみると、
「お探しのページが見つかりません。こちらには何もありません。検索をお試しください。」
と表示されてしまいます。なぜなのでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。