Questions tagged «page-attributes»

2
将页面属性元框和页面模板添加到帖子编辑页面?
(主持人注意:标题最初是“如何向POSTS编辑器添加“页面属性”和/或“页面属性>模板”选择器”) WP当前仅允许将“模板”分配给Pages(即post_type=='page'。),我也想将此功能扩展到Posts(即,post_type=='post'。)。 如何将“页面属性”元框,更具体地说是模板切换器添加到帖子编辑器? 我假设这是我将放置在functions.php主题代码中的代码。 更新:通过将选择框html添加到我现有的自定义元选项框中,我设法将硬编码模板下拉菜单添加到我的帖子编辑器中。这是我正在使用的代码... add_meta_box('categorydiv2', __('Post Options'), 'post_categories_meta_box_modified', 'post', 'side', 'high'); 这是写出选项和模板选择框的函数... //adds the custom categories box function post_categories_meta_box_modified() { global $post; if( get_post_meta($post->ID, '_noindex', true) ) $noindexChecked = " checked='checked'"; if( get_post_meta($post->ID, '_nofollow', true) ) $nofollowChecked = " checked='checked'"; ?> <div id="categories-all" class="ui-tabs-panel"> <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.