0
我將自定義帖子類型添加到名爲Projects的主題中。它使用內置的類別分類,但無法獲得前端列出的項目類別帖子。自定義帖子類型的類別列表頁面
這裏是我的,我用來創建自定義文章類型
// Register Custom Post Type
功能custom_post_type(){
$labels = array(
'name' => 'Projects',
'singular_name' => 'Project',
'menu_name' => 'Projects',
'parent_item_colon' => 'Parent Item:',
'all_items' => 'All Items',
'view_item' => 'View Item',
'add_new_item' => 'Add New Item',
'add_new' => 'Add New',
'edit_item' => 'Edit Item',
'update_item' => 'Update Item',
'search_items' => 'Search Item',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
);
$args = array(
'label' => 'projects',
'description' => 'Project Description',
'labels' => $labels,
'supports' => array('title', 'editor', 'excerpt', 'thumbnail',),
'taxonomies' => array('category', 'post_tag'),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type('projects', $args);
Thanks flowb0b。這樣查詢會打破常規分頁,這已經是主題的一部分,或者我可以繼續使用現有分頁? – tosca 2015-01-28 10:18:54
我建議在短代碼中加入你的分頁。類似的問題在這裏:http://stackoverflow.com/questions/11430392/wordpress-pagination-in-a-shortcode – schliflo 2015-01-28 12:13:28