カスタム投稿タイプとカスタム分類で 投稿の一覧をページに表示
-
以下のサイトを参考にさせて頂き、カスタム投稿タイプとカスタム分類を作りました。
http://www.h-fj.com/blog/archives/2010/07/02-105158.php
add_action('init', 'hoge_custom_post_type'); function hoge_custom_post_type(){ $labels = array( 'name' => _x('hoge', 'post type general name'), 'singular_name' => _x('hoge', 'post type singular name'), 'add_new' => _x('hogeを追加', 'book'), 'add_new_item' => __('新しいhogeを追加'), 'edit_item' => __('hogeを編集'), 'new_item' => __('新しいhoge'), 'view_item' => __('プレビュー'), 'search_items' => __('hoge内で探す'), 'not_found' => __('hogeはありません'), 'not_found_in_trash' => __('ゴミ箱にhogeはありません'), '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, 'menu_position' => 5, 'supports' => array('title','editor','author','custom-fields','revisions'), 'show_in_nav_menus' => true ); register_post_type('hoge',$args); $args = array( 'label' => 'hogehogeカテゴリ', 'labels' => array( 'name' => 'hogehogeカテゴリ', 'singular_name' => 'hogehogeカテゴリ', 'search_items' => 'hogehogeカテゴリを検索', 'popular_items' => 'よく使われているhogehogeカテゴリ', 'all_items' => 'すべてのhogehogeカテゴリ', 'parent_item' => 'hogehogeカテゴリ', 'edit_item' => 'hogehogeカテゴリの編集', 'update_item' => '更新', 'add_new_item' => 'hogehogeカテゴリを追加', 'new_item_name' => 'hogehogeカテゴリ', ), 'public' => true, 'show_ui' => true, 'hierarchical' => true, 'show_tagcloud' => true ); register_taxonomy('hogehoge', 'hoge', $args); }
hogehogeに作成したカテゴリ A、B
やりたい事は、
同一ページ内にAの記事タイトル一覧とBの記事タイトル一覧をそれぞれ載せたいのです。page-hoge.phpを作成して、色々試行錯誤して
hogeの記事タイトル一覧は作成できたのですが、カテゴリ毎がうまくできません。
アーカイブでは表示されます。ページに表示させるにはどうすればいいのか
教えていただけないでしょうか。よろしくお願いします。
4件の返信を表示中 - 1 - 4件目 (全4件中)
4件の返信を表示中 - 1 - 4件目 (全4件中)
- トピック「カスタム投稿タイプとカスタム分類で 投稿の一覧をページに表示」には新たに返信することはできません。