你好@Jonathan Sampson:
@EAMann很在行,定制帖子类型才是最好的选择。
这是你可以在主题中加入的代码functions.php
文件来实现所需的自定义帖子类型(注意我包含了一个helper函数)make_post_type_labels()
我喜欢使用它来降低定义自定义帖子类型的复杂性):
register_post_type(\'daily-video\',
array(
\'labels\' => make_post_type_labels(\'Daily Video\'),
\'public\' => true,
\'show_ui\' => true,
\'query_var\' => \'daily-video\',
\'rewrite\' => array(\'slug\' => \'daily-videos\'),
\'hierarchical\' => true,
\'supports\' => array(\'title\',\'editor\',
)
);
function make_post_type_labels($singular,$plural=false,$args=array()) {
if ($plural===false)
$plural = $singular . \'s\';
elseif ($plural===true)
$plural = $singular;
$defaults = array(
\'name\' =>_x($plural,\'post type general name\'),
\'singular_name\' =>_x($singular,\'post type singular name\'),
\'add_new\' =>_x(\'Add New\',$singular),
\'add_new_item\' =>__("Add New $singular"),
\'edit_item\' =>__("Edit $singular"),
\'new_item\' =>__("New $singular"),
\'view_item\' =>__("View $singular"),
\'search_items\' =>__("Search $plural"),
\'not_found\' =>__("No $plural Found"),
\'not_found_in_trash\' =>__("No $plural Found in Trash"),
\'parent_item_colon\' =>\'\',
);
return wp_parse_args($args,$defaults);
}
此外,您可能会发现以下两个答案也很有帮助: