每个人都知道基本的WordPress循环,每个人都知道如果你只想在一个循环中放置帖子query_posts("post_type=post");
BEFORE 循环。我已经做到了。
问题是我有一个自定义的帖子类型,称为mini feed,它出现在我的循环中,问题是,它是唯一出现的东西。我有60个职位,职位类型下的职位和NONE 其中,只有这一个(因为目前只有一个)迷你提要出现。
自定义帖子类型如下所示:
public function aisis_mini_feed() {
$labels = array(
\'name\' => _x( \'Mini-Feeds\', \'Post Type General Name\', \'text_domain\' ),
\'singular_name\' => _x( \'Mini-Feed\', \'Post Type Singular Name\', \'text_domain\' ),
\'menu_name\' => __( \'Mini-Feed\', \'text_domain\' ),
\'parent_item_colon\' => __( \'Parent Mini-Feed:\', \'text_domain\' ),
\'all_items\' => __( \'All Mini-Feeds\', \'text_domain\' ),
\'view_item\' => __( \'View Mini-Feed\', \'text_domain\' ),
\'add_new_item\' => __( \'Add New Mini-Feed\', \'text_domain\' ),
\'add_new\' => __( \'New Mini-Feed\', \'text_domain\' ),
\'edit_item\' => __( \'Edit Mini-Feed\', \'text_domain\' ),
\'update_item\' => __( \'Update Mini-Feed\', \'text_domain\' ),
\'search_items\' => __( \'Search Mini-Feeds\', \'text_domain\' ),
\'not_found\' => __( \'No mini-feeds found\', \'text_domain\' ),
\'not_found_in_trash\' => __( \'No mini-feeds found in Trash\', \'text_domain\' ),
);
$rewrite = array(
\'slug\' => \'mini-feed\',
\'with_front\' => true,
\'pages\' => false,
\'feeds\' => true,
);
$args = array(
\'label\' => __( \'mini-feed\', \'text_domain\' ),
\'description\' => __( \'Mini-Feed custom post type\', \'text_domain\' ),
\'labels\' => $labels,
\'supports\' => array( \'title\', \'editor\', \'author\', \'thumbnail\', \'revisions\', ),
\'hierarchical\' => false,
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'show_in_nav_menus\' => true,
\'show_in_admin_bar\' => true,
\'menu_icon\' => \'http://icons.iconarchive.com/icons/fatcow/farm-fresh/32/folders-icon.png\',
\'can_export\' => true,
\'has_archive\' => true,
\'exclude_from_search\' => true,
\'publicly_queryable\' => true,
\'query_var\' => \'mini-feed\',
\'capability_type\' => \'post\',
);
register_post_type( \'mini-feed\', $args );
}
My question?
<为什么这个迷你提要出现在我的循环中我其余的帖子都到哪里去了
My loop
query_posts("post_type=post");
if(have_posts()){
while(have_posts()){
the_post();
the_title();
the_content();
}
}