Title: twentyfourteenのフィーチャードエリアにカスタム投稿記事を表示させたい
Last modified: 2016年9月15日

---

# twentyfourteenのフィーチャードエリアにカスタム投稿記事を表示させたい

 *  解決済 [layperson](https://ja.wordpress.org/support/users/layperson/)
 * (@layperson)
 * [11年、 2ヶ月前](https://ja.wordpress.org/support/topic/twentyfourteen%e3%81%ae%e3%83%95%e3%82%a3%e3%83%bc%e3%83%81%e3%83%a3%e3%83%bc%e3%83%89%e3%82%a8%e3%83%aa%e3%82%a2%e3%81%ab%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e8%a8%98%e4%ba%8b/)
 * twentyfourteenに子テーマを作ってカスタマイズしています。
    フィーチャードエリア
   にCustom Post Type UIで設定したカスタム投稿記事を反映させたいです。 以前フォーラム
   にありました→[https://ja.forums.wordpress.org/topic/117876?replies=6](https://ja.forums.wordpress.org/topic/117876?replies=6)
   のページを参考にしましたが、表示されません。
 * 子テーマに親テーマの『inc/featured-content.php』をコピペして設置しています。以前
   のフォーラムのコードと少し変わっているように思うのですが、”’post_type’ => array(‘
   post’, ‘myposttype’)”を記述する位置が間違っているのでしょうか。
    inc/featured-
   content.phpの160行目あたりのコードにこのように追加しました。↓
 *     ```
       if ( $term ) {
       				// Query for featured posts.
       				$featured_ids = get_posts( array(
       					'post_type' => array('post', 'myposttype'),
       					'fields'           => 'ids',
       					'numberposts'      => self::$max_posts,
       					'suppress_filters' => false,
       					'tax_query'        => array(
       						array(
       							'field'    => 'term_id',
       							'taxonomy' => 'post_tag',
       							'terms'    => $term->term_id,
       						),
       					),
       				) );
       			}
       ```
   
 * WordPressは手探りでphpを触るレベルです。
    よろしくお願いいたします。

2件の返信を表示中 - 1 - 2件目 (全2件中)

 *  [gblsm](https://ja.wordpress.org/support/users/gblsm/)
 * (@gblsm)
 * [11年、 2ヶ月前](https://ja.wordpress.org/support/topic/twentyfourteen%e3%81%ae%e3%83%95%e3%82%a3%e3%83%bc%e3%83%81%e3%83%a3%e3%83%bc%e3%83%89%e3%82%a8%e3%83%aa%e3%82%a2%e3%81%ab%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e8%a8%98%e4%ba%8b/#post-196425)
 * Twenty Fourteen のバージョン 1.5 の場合は二箇所に追加する必要があります。ひとつ
   はlaypersonさんが追加したところ、もうひとつは同じ featured-content.php の131行
   目に出てくるget_postsです。こちらにも同じように投稿タイプを指定します。
 * オリジナル：
 *     ```
       $featured_posts = get_posts( array(
       	'include'        => $post_ids,
       	'posts_per_page' => count( $post_ids ),
       ) );
       ```
   
 * 追加後（この例は myposttype を追加）：
 *     ```
       $featured_posts = get_posts( array(
       	'post_type'      => array( 'post', 'myposttype' ),
       	'include'        => $post_ids,
       	'posts_per_page' => count( $post_ids ),
       ) );
       ```
   
 *  トピック投稿者 [layperson](https://ja.wordpress.org/support/users/layperson/)
 * (@layperson)
 * [11年、 2ヶ月前](https://ja.wordpress.org/support/topic/twentyfourteen%e3%81%ae%e3%83%95%e3%82%a3%e3%83%bc%e3%83%81%e3%83%a3%e3%83%bc%e3%83%89%e3%82%a8%e3%83%aa%e3%82%a2%e3%81%ab%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e8%a8%98%e4%ba%8b/#post-196427)
 * gblsmさん
 * ありがとうございます！
    Twenty Fourteenのバージョンは1.5でした。 教えていただ
   いた通りに追加しましたら表示されました！ 何週間もここで頭を抱えていましたので
   本当に助かりました。 ありがとうございます。

2件の返信を表示中 - 1 - 2件目 (全2件中)

 トピック「twentyfourteenのフィーチャードエリアにカスタム投稿記事を表示させたい」
には新たに返信することはできません。

## タグ

 * [カスタム投稿](https://ja.wordpress.org/support/topic-tag/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf/)
 * [フィーチャードエリア](https://ja.wordpress.org/support/topic-tag/%e3%83%95%e3%82%a3%e3%83%bc%e3%83%81%e3%83%a3%e3%83%bc%e3%83%89%e3%82%a8%e3%83%aa%e3%82%a2/)
 * [twentyfourteen](https://ja.wordpress.org/support/topic-tag/twentyfourteen/)

 * フォーラム: [使い方全般](https://ja.wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2件の返信
 * 2人の参加者
 * 最後の返信者: [layperson](https://ja.wordpress.org/support/users/layperson/)
 * 最後の活動: [11年、 2ヶ月前](https://ja.wordpress.org/support/topic/twentyfourteen%e3%81%ae%e3%83%95%e3%82%a3%e3%83%bc%e3%83%81%e3%83%a3%e3%83%bc%e3%83%89%e3%82%a8%e3%83%aa%e3%82%a2%e3%81%ab%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e8%a8%98%e4%ba%8b/#post-196427)
 * 状態: 解決済

## トピック

### 人気のトピック

### 返信がないトピック

### サポート関連ではないトピック

### 解決済みのトピック

### 未解決のトピック

### すべてのトピック
