0
맞춤 게시 유형을 만들었습니다. 나는 또한 single-projects.php를 가지고있다. 그러나 어떤 이유에서 커스텀 포스트는 템플릿을 사용하지 않을 것이다. 나는 permalinks를 내뿜 으려고 노력했다. Themefortress Reverie Theme를 사용하고 있습니다.맞춤 게시 템플릿이 작동하지 않습니다.
class projects_post_type {
function projects_post_type() {
add_action('init',array($this,'create_post_type'));
}
function create_post_type() {
$labels = array(
'name' => 'Projects',
'singular_name' => 'Project',
'add_new' => 'Add new',
'all_items' => 'All Projects',
'add_new_item' => 'Add New Project',
'edit_item' => 'Edit Project',
'new_item' => 'New Project',
'view_item' => 'View Project',
'search_items' => 'Search Project',
'not_found' => 'No Projects found',
'not_found_in_trash' => 'No Projects found in trash',
'parent_item_colon' => 'Parent Project:',
'menu_name' => 'Projects'
);
$args = array(
'taxonomies' => array('category','post_tag'),
'labels' => $labels,
'description' => "All Consplan Projects",
'public' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'show_in_menu' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => null,
'capability_type' => 'post',
'hierarchical' => true,
'supports' => array('title','editor','thumbnail','excerpt','custom-fields'),
'has_archive' => true,
'rewrite' => array('slug' => 'projects', 'with_front' => false),
'query_var' => true,
'can_export' => true
);
register_post_type('projects_post_type',$args);
}
}
$projects_post_type = new projects_post_type();
?>
원본 코드입니까? 아니면 그냥 예를 들어? –
내가 사용하고있는 원본 코드 – user2997903