0

新しいカスタム投稿タイプを作成した後、ホームページに表示されない nav_menu に小さな問題があります。

これは、functions.php に入れたコードです。

add_action('init', 'create_companies_type');
    function create_companies_type(){
    register_post_type('information', array(
     'label' => __('Nos informations'),
     'singular_label' => __('information'),
     'public' => true,
     'show_ui' => true,
     'capability_type' => 'post',
     'hierarchical' => false,
     'supports' => array('title', 'author', 'thumbnail','editor','custom-fields'),
    ));
}

add_filter( 'pre_get_posts', 'my_get_posts' );

  function my_get_posts( $query ) {
  if ( is_home())
  $query->set( 'post_type', array( 'information','post') );

  return $query;
}

あなたが私を助けることができれば、私は本当に感謝します. ありがとう

4

1 に答える 1

0

カスタムメニューエリアに表示される投稿タイプについて話している場合は、そこにあります. 私はちょうどあなたが何を意味するかを推測しています。

于 2012-05-13T16:50:36.327 に答える