首页 > Wordpress相关 > WordPress后台菜单改造–适合企业网站后台
2010十二月10

WordPress后台菜单改造–适合企业网站后台


改造后的效果,可以添加企业网站后台常用的一些菜单
只要在主题目录/function.php文件里添加如下代码就好了

// 创建叫做“products”类型的内容 
register_post_type('products', array( 'label' =>  '产品', 'public' => true, 'show_ui' => true, 'capability_type'  => 'post', 'hierarchical' => false, 'rewrite' => false, 'query_var' => true, 'supports' => array(  'title', 'editor', 'excerpt', 'trackbacks', 'custom-fields', 'comments',  'revisions', 'thumbnail', 'author', 'page-attributes',) ) );
 
// 创建叫做“people”类型的内容 
register_post_type('people', array( 'label' =>  '人物', 'public' => true, 'show_ui' => true, 'capability_type'  => 'post', 'hierarchical' => false, 'rewrite' => false, 'query_var' => true, 'supports' => array(  'title', 'editor', 'excerpt', 'trackbacks', 'custom-fields', 'comments',  'revisions', 'thumbnail', 'author', 'page-attributes',) ) );
 
// 创建叫做“movies”类型的内容 
register_post_type('movies', array( 'label' =>  '视频', 'public' => true, 'show_ui' => true, 'capability_type'  => 'post', 'hierarchical' => false, 'rewrite' => false, 'query_var' => true, 'supports' => array(  'title', 'editor', 'excerpt', 'trackbacks', 'custom-fields', 'comments',  'revisions', 'thumbnail', 'author', 'page-attributes',) ) );

如果要支持固定链接,请将 ‘rewrite’ => false修改为’rewrite’ => array(‘slug’ => ‘products’)

本文目前尚无任何评论.

发表评论