2012-05-12 45 views
0

我有一個nav_menu小問題,我沒有出現在我的主頁後,我創建了一個新的自定義帖子類型。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; 
} 

如果你能幫助我,我真的很感激代碼。 謝謝

回答

0

如果您正在討論在您自定義菜單區域中顯示的帖子類型,那麼它就在那裏。我只是猜測你的意思。

+0

謝謝,先生,您的快速回答!但這不是我的問題。 我的問題是我的默認菜單沒有出現在主頁上 –

相關問題