嗨,谢谢你的阅读。
我想将帖子作者插入到我的自定义帖子类型slug中。
示例:http://example.com/charts/%author%/
有没有办法做到这一点?
以下是我的自定义帖子类型:
register_post_type(\'charts\', array(
\'label\' => \'Charts\',
\'description\' => \'\',
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'rewrite\' => array(\'slug\' => \'/charts/author\'),
\'query_var\' => true,
\'supports\' => array(
\'title\',
\'editor\',
\'trackbacks\',
\'custom-fields\',
\'comments\',
\'author\',
),
\'labels\' => array (
\'name\' => \'Charts\',
\'singular_name\' => \'Charts\',
\'menu_name\' => \'Charts\',
\'add_new\' => \'Add Charts\',
),
));
blessjnz公司