【问题标题】:Customize WordPress Editor自定义 WordPress 编辑器
【发布时间】:2012-12-06 15:14:15
【问题描述】:

对不起,如果我的术语令人困惑,但我不确定这到底是什么。

在 Wordpress 中编辑帖子或页面类型时,在编辑器的右侧有“发布”、“属性”、“特色图片”等部分。我想知道是否有一种方法可以添加自己的部分右边像另一个?是自定义帖子类型还是更复杂的东西?

我正在尽量避免使用钩子。

【问题讨论】:

    标签: php wordpress


    【解决方案1】:

    那些是“元框”

    http://codex.wordpress.org/Function_Reference/add_meta_box

    function my_custom_meta_boxes()
    {
      add_meta_box(
        'custom1', // id
        'Custom Metabox', // title
        'display_custom_meta_box', // callback for display
        'post', // post type
        'normal', // position
        'high' // priority
      );
    }
    add_action('add_meta_boxes', 'my_custom_meta_boxes');
    
    function display_custom_meta_box()
    {
      echo 'Your meta box here';
    }
    

    有一些插件可用于快速创建元框,例如

    http://wordpress.org/extend/plugins/meta-box/

    http://wordpress.org/extend/plugins/types/

    【讨论】:

      【解决方案2】:

      http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

      在这里阅读它^ 用谷歌搜索并不难! :)

      【讨论】:

      • 用谷歌搜索我不想要的答案并不难。我要求修改编辑器(带有 WYSWIG 的页面),现在是页面模板。
      猜你喜欢
      • 2019-07-16
      • 2014-07-27
      • 2013-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多