WordPressのページには、「投稿ページ」と「固定ページ」が、デフォルトで備わっていますが、これに加えて、もう一つ別の「投稿ページ」が、必要とするケースがあるかと思います。
以下のソースコードをfunctionにコピペすれば、新たに「お知らせページ」を設置することができます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
add_action('init', 'create_post_type'); function create_post_type() { $labels = array( 'name' => __('お知らせ'), 'singular_name' => __('お知らせ'), ); $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'menu_position' => 11, 'supports' => array('title','editor','thumbnail','custom-fields','excerpt','author','trackbacks','comments','revisions','page-attributes'), 'taxonomies' => array( 'category', 'post_tag' ) ); register_post_type('original_products',$args); } |