wordpress分类目录添加可视化编辑器


测速网在给客户仿站的时候遇到一个问题,同分类下子分类要分别有页面级分类栏目,那怎样实现呢,测速网想了一个方法,那就是退一步,怎么在分类目录下做开发,做成一个独立页面内容的样式,那最简单的就是在分类目录编辑里添加编辑器。下面推荐给推荐给大家一段添加编辑器代码亲测可用

16171819202122232425262728293031323334353637383940414243/** * wordpress分类目录添加可视化编辑器 * */// 移除HTML过滤remove_filter( 'pre_term_description', 'wp_filter_kses' );remove_filter( 'term_description', 'wp_kses_data' );//为分类编辑界面添加可视化编辑器的“描述”框add_filter('edit_category_form_fields', 'cat_description');function cat_description($tag){?><table ><tr ><th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th><td><?php$settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '15', 'textarea_name' => 'description' );wp_editor(wp_kses_post($tag->description , ENT_QUOTES, 'UTF-8'), 'cat_description', $settings);?><br /><span ><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td></tr></table><?php}//移除默认的“描述”框add_action('admin_head', 'remove_default_category_description');function remove_default_category_description(){global $current_screen;if ( $current_screen->id == 'edit-category' ){?><script type="text/javascript">jQuery(function($) {$('textarea#description').closest('tr.form-field').remove();});</script><?php}}


上一篇:WordPress时间格式为几分钟之前几小时之前

下一篇:wordpress指定分类从第二篇文章开始调用代码


分类目录
Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器