2013-09-21 29 views
0

我想在wordpress中创建一个主题,我需要添加下它说'帖子'的另一个页面名为投资组合,这将行事相同的职位页面,但使用/ portfolio/post-title链接而不是/ blog/post-title。有可能是这个教程,但我无法找到任何具体的我在做什么。如何添加一个额外的菜单WordPress的管理屏幕

回答

0

是的,这里有几千个教程,如果不是数百万。我假设你没有尝试过很多?你应该考虑的功能是 “自定义文章类型”

例子:

function codex_custom_init() { 
    $labels = array(
    'name' => 'Books', 
    'singular_name' => 'Book', 
    'add_new' => 'Add New', 
    'add_new_item' => 'Add New Book', 
    'edit_item' => 'Edit Book', 
    'new_item' => 'New Book', 
    'all_items' => 'All Books', 
    'view_item' => 'View Book', 
    'search_items' => 'Search Books', 
    'not_found' => 'No books found', 
    'not_found_in_trash' => 'No books found in Trash', 
    'parent_item_colon' => '', 
    'menu_name' => 'Books' 
); 

    $args = array(
    'labels' => $labels, 
    'public' => true, 
    'publicly_queryable' => true, 
    'show_ui' => true, 
    'show_in_menu' => true, 
    'query_var' => true, 
    'rewrite' => array('slug' => 'book'), 
    'capability_type' => 'post', 
    'has_archive' => true, 
    'hierarchical' => false, 
    'menu_position' => null, 
    'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments') 
); 

    register_post_type('book', $args); 
} 
add_action('init', 'codex_custom_init'); 

资源:

相关问题