WordPress 主题发布:Nest

WordPress Theme: Nest

笔者的 WP 主题处女作 Nest 已于 2011 年 7 月 10 日正式被 WordPress 官方添加至其主题目录中。

这款主题笔者从今年三月份就开始提交了,一直审核不通过。从起初的机器审核(Automated Theme Scanning)到后面的人工审核(Test Data 等),前后共历时约四个月,更换了四个版本号(从 1.0.0 到 1.0.4)。期间不断修改和增删了许多功能代码。

本文将简要介绍在这漫长的提交过程中,审核机制所报出的各种问题和其相应的解决办法,以及得出的一些结论。望大家能从中得益。

今年年初以来,WordPress 官方突然加强了对主题的审核机制(不知插件审核是否变严格了?),使得许多新主题或是旧主题更新都难以通过审核。春节前后更是耗时漫长,据说一次 TracTicket 要两个星期才有回复,但现在不会了。:-)

主题审核的部分苛刻条件

此处主要是列举了最近变严格了的条例:

  • W3C CSS and HTML Validation:每个页面都必须完完全全地通过。
  • 主题文件中出现的函数和全局变量(global variables)的名称,必须以主题英文名加下划线作为前缀,缺一不可。(如 nest_theme_options_do_page()$nest_options 等)
  • 文字域(Text domain problems):函数 load_theme_textdomain 我们一般是在 add_action( 'after_setup_theme', ... 中调用的,问题仍然出现的原因最大可能是在脚本中直接使用了诸如“_e( 'Home' );”而非“_e( 'Home', 'nest' );”的翻译代码。简单讲就是 WordPress 程序自带的语言文字域是不能给主题使用的,即使看起来没问题。
  • WP 单元测试(Test Data)必须全部达到要求。
  • style.css 文件的头部主题信息中,每一项的冒号后不能有空格,否则字段将被识别为空。

以上是本主题在提交过程中遇到的比较囧的问题。

必备基础条件

如果您正准备提交主题,请您根据以下几点要求测试您的主题:

  1. 安装 Theme Check 插件,并在必要时进行测试。到 WP 上传的第一轮审核机制即此。
  2. 到 WP Theme Unit Test(http://codex.wordpress.org/Theme_Unit_Test)下载 test-data 文件并用 WP 内置的导入功能导入全部数据(包括所有附件和媒体),然后按照 Theme Unit Test 页面中要求的 WordPress Settings 逐一设置好 WP,并在需要时进行全面测试(主要看各篇文章内容中的要求)。
  3. 设置 WP 配置文件 wp-config.php 中的常量“define('WP_DEBUG', true);”。
  4. W3C CSS and HTML Validation。这个不用多说,值得注意的就是测试用的数据最好是 WP Theme Unit Test 用的 Test Data,然后就是禁用全部插件。

Nest 主题相关链接



《“WordPress 主题发布:Nest”》 有 41 条评论

  • http://www.welefen.com/google-plus-for-wordpress-theme.html 今天刚弄完一个界面类似于google plus的主题,请多多指教。

  • Hi there.
    I think your theme is brilliant and exactly what I'm looking for. One question: I have tried everything and can't create a simple 'web page' like your 'profile' page. I want to do 'about me' etc without the blog stuff.
    I can't write code - is there a plugin that will help?
    Kind regards
    Kiaron

    • Hello Kiaron,
      In the visual post editor, you can click "format: Heading 3" button to make an entry title, and "Unordered list" button to make a point-before list.

      Also, these HTML code will help you:

      [About Me]

      • Line one;
      • Line two;
      • Line three;

      Just copy and modify them. :wink:

  • Hi Chong, great work with this theme - It is really simple and light... Just want an help from you - Im trying to insert the jump more code in functions.php file and i am not being successful in doing it. Can you help please? i want to display the full post when somebody clicks on "Read more"

    • Hello Sagar,
      Please don't modify functions.php file just in order to make "Read more" link visible.
      To display the "Read more" link, please go to the post editor, and click "Insert More Tag" button on the editor toolbar in where you want to put the "Read more" link. ( also in the HTML edit mode, click "more" button on the editor toolbar. )
      Thanks for your support! Enjoy it :cool:

      • Sorry you got me wrong here! What i am looking for is - when somebody clicks on the read more it should show up the full post and not the portion after "more" tag.

        I tried inserting this code in functions.php

        function remove_more_jump_link($link) {
        $offset = strpos($link, '#more-');
        if ($offset) {
        $end = strpos($link, '"',$offset);
        }
        if ($end) {
        $link = substr_replace($link, '', $offset, $end-$offset);
        }
        return $link;
        }
        add_filter('the_content_more_link', 'remove_more_jump_link');

        Hope you got my point!

        • Oh I'm sorry.
          But I've tested these codes, it did work as expected.
          Make sure other files were not modified by accident.
          Thank you. :idea:

  • 你好, YChong!

    我在wp官网上看到你提供的模板,很是喜欢,下了下来,后来测试了一下,我发现导航菜单的显示有点小缺陷:如果一个父菜单有子菜单的话,鼠标移到上面显示出来的子菜单栏会覆盖掉附近其他父菜单,并且无法选择。

    • 你好,

      这个问题似乎只发生在 IE 7 浏览器上,不过 Nest 主题的下一个版本将会通过 JavaScript 实现多级菜单功能,可兼容所有主流浏览器,同时修复这个问题。

      还请见谅,期待下一个版本吧 :razz:

  • 表示期待下一个版本。同时能不能把我选择的 :oops: 诸如这个表情的边上加上中文解释哇。我不是故意找茬的。

  • Hi,

    I'm here to say your theme is very nice :)

    I found a little problem so, let's solve it.

    index.php file has this line:

    Problem is the _e( 'by', 'nest ') function. Note the 'extra' space after "nest". This space make impossible to create a valid .po translation file. Just remove it and... voilà, it works fine now.

  • 这个nest主题很不错哈。
    谢谢你的分享和卓越的工作。

    不过发现一个小问题,不知是否个案?
    文章阅读页面,点击post-meta中的发表评论,无反应,我看了下,将#comments变更为#respond就对了。。。

  • Hi, Thanks for this beautiful theme.

    I have a request - can you add a feature to show two (left & right) sidebars at the same time?

    Or, if not, can you only show me how to do that in the existing theme (v 1.1.5)? I can handle the CSS part, just not the PHP! :neutral:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注