新しいカスタム投稿タイプを作成した後、ホームページに表示されない 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;
}
あなたが私を助けることができれば、私は本当に感謝します. ありがとう