Wordpress:nav_menu不会出现在主页中

时间:2012-05-12 22:21:56

标签: wordpress

我创建新的自定义帖子类型后,我的主页中没有出现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;
}

如果你能帮助我,我真的很感激。 感谢

1 个答案:

答案 0 :(得分:0)

如果您正在谈论自定义菜单区域中显示的帖子类型,那么它就在那里。我只想猜你的意思。

相关问题