Friday, December 22, 2006

Wordpress分页标签

用过wordcodess 1.5版本的朋友应该都知道编辑器有个默认的"page"按钮,这是长文章分页用的,到了wordcodess 2.0版本之后,这个默认的"page"按钮就没有了,被"more"按钮取代了,其实我们还是可以使用他,<!--nextpage--> 这个分页标签就可以做到,如果想要添加编辑器按钮,在tinymce或者简单的编辑环境中都可以,只要取掉注释就可以了

  1. 在简单的编辑环境中,wp-includes/js/quicktags.js 文件中找到

    edButtons[edButtons.length] =
    new edButton('ed_next'
    ,'page'
    ,'<!--nextpage-->'
    ,''
    ,'p'
    ,-1
    );

    去掉注释代码就可以了

  2. 在TinyMCE环境中,wp-includes/js/tinymce/plugins/wordcodess/editor_plugin.js,找到 TinyMCE_wordcodess_getControlHTML 函数,替换为

    function TinyMCE_wordcodess_getControlHTML(control_name) {
    switch (control_name) {
    case "wordcodess":
    var titleMore = tinyMCE.getLang('lang_wordcodess_more_button');
    var titlePage = tinyMCE.getLang('lang_wordcodess_page_button');
    var titleHelp = tinyMCE.getLang('lang_wordcodess_help_button');
    var buttons = '';
    return buttons;
    }
    return '';
    }

    就可以了

1 comment:

  1. Since the admin of this website is working,
    no question very quickly it will be well-known,
    due to its quality contents.

    ReplyDelete