我是否错误地声明了自定义帖子类型?
我的永久链接只在我的网站上间歇工作。
我相信我的服务器设置正确;我在Wordpress安装的同时安装了一些Drupal,它们干净的URL/htaccess规则运行良好。
我也尝试过禁用所有插件,但没有效果。
我会错过什么?
提前谢谢。
function five_oh_one_customizations_custom_post_types(){
$homepage_args = array(
\'public\' => true,
\'supports\' => array(
\'title\', \'editor\', \'thumbnail\', \'custom_fields\', \'revisions\'
),
\'labels\' => array(
\'name\' => \'Homepages\',
\'singular_name\' => \'Homepage\',
\'add_new\' => \'Add new Homepage\',
\'add_new_item\' => \'Add new Homepage\',
\'edit_item\' => \'Edit Homepage\',
\'new_item\' => \'New Homepage\',
\'view_item\' => \'View Homepage\',
\'not_found\' => \'No Homempages found\',
\'not_found_in_trash\' => \'No Homepagess found in trash\'
),
\'hiearchial\' => false,
\'rewrite\' => array(
\'with_front\' => false,
\'slug\' => \'/\',
\'feeds\' => false,
\'pages\' => false
),
\'has_archive\' => false,
\'query_var\' => \'homepage\',
\'show_in_nav_menus\' => false,
\'menu_position\' => 2);
$grantee_args = array(
\'public\' => true,
\'supports\' => array(
\'title\', \'editor\', \'thumbnail\', \'custom_fields\', \'revisions\'
),
\'labels\' => array(
\'name\' => \'Grantees\',
\'singular_name\' => \'Grantee\',
\'add_new\' => \'Add new Grantee\',
\'add_new_item\' => \'Add new Grantee\',
\'edit_item\' => \'Edit Grantee\',
\'new_item\' => \'New Grantee\',
\'view_item\' => \'View Grantee\',
\'search_item\' => \'Search Grantees\',
\'not_found\' => \'No Grantees found\',
\'not_found_in_trash\' => \'No Grantees found in trash\'
),
\'capability_type\' => \'post\',
\'hiearchial\' => false,
\'rewrite\' => array(
\'slug\' => \'grantee\',
),
\'has_archive\' => true,
\'show_in_nav_menus\' => false,
\'query_var\' => \'grantee\',
\'menu_position\' => 3
);
$grantee_project_args = array(
\'public\' => true,
\'supports\' => array(
\'title\', \'editor\', \'thumbnail\', \'custom_fields\', \'revisions\'
),
\'labels\' => array(
\'name\' => \'Grantee Projects\',
\'singular_name\' => \'Grantee Project\',
\'add_new\' => \'Add new Grantee Project\',
\'add_new_item\' => \'Add new Grantee Project\',
\'edit_item\' => \'Edit Grantee Project\',
\'new_item\' => \'New Grantee Project\',
\'view_item\' => \'View Grantee Project\',
\'search_item\' => \'Search Grantee Projects\',
\'not_found\' => \'No Grantee Projects found\',
\'not_found_in_trash\' => \'No Grantee Projects found in trash\'
),
\'capability_type\' => \'post\',
\'hiearchial\' => false,
\'rewrite\' => array(
\'slug\' => \'grantee-project\'
),
\'has_archive\' => true,
\'show_in_nav_menus\' => false,
\'query_var\' => \'grantee_project\',
\'menu_position\' => 4
);
//create custom content types - we\'ll add the custom fields manually in the ui with the Advanced Custom Fields plugin
//http://www.advancedcustomfields.com/docs/getting-started/
register_post_type(\'homepage\', $homepage_args);
register_post_type(\'grantee\', $grantee_args);
register_post_type(\'grantee_project\', $grantee_project_args);
//create custom taxonomy for grantee project content type
$taxonomy_args = array(
\'public\' => true,
\'show_ui\' => true,
\'hierarchical\' => true,
\'query_var\' => \'grantee_project_taxonomy\',
\'rewrite\' => false,
\'show_tagcloud\' => false,
\'show_in_nav_menus\' => false,
\'capabilities\' => array(
\'manage_terms\' => \'do_not_alllow\',
\'edit_terms\' => \'do_not_allow\',
\'delete_terms\' => \'do_not_allow\',
\'assign_terms\' => \'edit_posts\'
),
\'labels\' => array(
\'name\' => \'Investment Categories\',
\'singular_name\' => \'Investment Category\',
\'all_items\' => \'All Categories\',
\'parent_item\' => \'Parent Category\',
)
);
register_taxonomy(\'grantee_project_categories\', array(\'grantee_project\'), $taxonomy_args);
}