选择自定义帖子类型的模板菜单?
|
我已经在wordpress中创建了几个自定义帖子类型,并且将hierarchy设置为true,以便其表现为页面。
问题是模板选择不可用。我已应用此技巧使菜单出现:
里面有一个文件meta-boxes.php
wp-admin \\包括wordpress
安装..文件的第547行,
这是功能
page_attributes_meta_box()仅添加
您特定职位的支票
输入名称以显示
模板页面下拉列表。
if ( (\'page\' == $post->post_type || \'yourcustomposttype\' == $post->post_type) && 0 != count( get_page_templates() ) ) {
$template = !empty($post->page_template) ? $post->page_template : false;
?>
这样可以成功显示菜单,但不会保存数据。 \“ parent \”部分保存,但\“ template \”未保存。
有人有什么想法吗?
没有找到相关结果
已邀请:
2 个回复
师埠女
渴翅吮斡撤