【发布时间】:2013-12-04 16:01:34
【问题描述】:
我如何列出分类中的所有帖子,例如我有“工作室”的示例
例子:
工作室:
-列表属性
-列表属性
-列表属性
-列表属性
/**
* Custom taxonomies
*/
function aviators_properties_create_taxonomies() {
$property_types_labels = array(
'name' => __( 'Property Types', 'aviators' ),
'singular_name' => __( 'Property Type', 'aviators' ),
'search_items' => __( 'Search Property Types', 'aviators' ),
'all_items' => __( 'All Property Types', 'aviators' ),
'parent_item' => __( 'Parent Property Type', 'aviators' ),
'parent_item_colon' => __( 'Parent Property Type:', 'aviators' ),
'edit_item' => __( 'Edit Property Type', 'aviators' ),
'update_item' => __( 'Update Property Type', 'aviators' ),
'add_new_item' => __( 'Add New Property Type', 'aviators' ),
'new_item_name' => __( 'New Property Type', 'aviators' ),
'menu_name' => __( 'Property Type', 'aviators' ),
);
register_taxonomy( 'property_types', 'property', array(
'labels' => $property_types_labels,
'hierarchical' => true,
'query_var' => 'property_type',
'rewrite' => array( 'slug' => __( 'property-type', 'aviators' ) ),
'public' => true,
'show_ui' => true,
) );
}
add_action( 'init', 'aviators_properties_create_taxonomies', 0 );
【问题讨论】:
标签: php wordpress custom-post-type taxonomy