{"id":2305,"date":"2011-12-21T11:22:49","date_gmt":"2011-12-21T03:22:49","guid":{"rendered":"https:\/\/www.wopus.org\/?p=2305"},"modified":"2011-12-21T11:22:49","modified_gmt":"2011-12-21T03:22:49","slug":"wordpress-33-%e7%89%88%e8%83%8c%e6%99%af%e5%8a%9f%e8%83%bd%e5%a4%b1%e6%95%88%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/wopus.org\/?p=2305","title":{"rendered":"WordPress 3.3\u80cc\u666f\u529f\u80fd\u5931\u6548\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<p>\u968f\u7740WordPress 3.3\u6b63\u5f0f\u7248\u7684\u53d1\u5e03\uff0c\u5f88\u591a\u76c6\u53cb\u90fd\u5728\u7b2c\u4e00\u65f6\u95f4\u5c06\u7a0b\u5e8f\u5347\u7ea7\u5230\u6700\u65b0\u7248\uff0c\u4e0d\u8fc7\u5f88\u5feb\u53d1\u73b0\u67d0\u4e9b\u5177\u5907\u201c\u80cc\u666f\u201d\u529f\u80fd\u7684\u4e3b\u9898\uff08\u5305\u62ec HotNews\u4e3b\u9898\uff09\u4e4b\u524d\u8bbe\u7f6e\u7684\u80cc\u666f\u5931\u6548\u4e86\u3002<\/p>\n<p>WordPress\u65e9\u57282.8\u7248\u5c31\u589e\u52a0\u4e86\u81ea\u5b9a\u4e49\u80cc\u666fbody_class()\u51fd\u6570\uff0c\u76f4\u52303.0\u7248\u624d\u5728\u9ed8\u8ba4\u4e3b\u9898\u4e2d\u589e\u52a0\u4e86\u201c\u80cc\u666f\u201d\u529f\u80fd\uff0c\u5177\u5907\u6b64\u529f\u80fd\u7684\u4e3b \u9898\u4e5f\u4e0d\u662f\u5f88\u591a\uff0c\u53ef\u80fd\u5927\u90e8\u5206\u4e3b\u9898\u8bbe\u8ba1\u8005\u4f1a\u89c9\u5f97\u8fd9\u4e2a\u529f\u80fd\u6709\u4e9b\u9e21\u808b\uff0c\u7b80\u5355\u901a\u8fc7\u4fee\u6539CSS\u6837\u5f0f\u5c31\u53ef\u5b9e\u73b0\u7684\u529f\u80fd\uff0c\u6ca1\u6709\u5fc5\u8981\u589e\u52a0\u4e00\u6b21\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u4f46\u8fd9\u53e5 body_class()\u51fd\u6570\u521d\u8877\uff0c\u5e76\u4e0d\u662f\u4e3a\u4e86\u7b80\u5355\u66f4\u6362\u6574\u4e2a\u7ad9\u70b9\u6240\u6709\u9875\u9762\u7684\u80cc\u666f\uff0c\u800c\u662f\u65b9\u4fbf\u8bbe\u8ba1\u4eba\u5458\u7075\u6d3b\u7684\u63a7\u5236\u4e0d\u540c\u9875\u9762\u4e2d\u5404\u4e2a\u5143\u7d20\u6837\u5f0f\uff0c\u5927\u9053\u7406\u4e0d\u8bf4\u4e86\uff0c\u4e0b\u9762 \u8bf4\u4e00\u4e0b\u5177\u4f53\u7684\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p><strong>\u65b9\u6848\u4e00 <\/strong>WordPress 3.3\u7248\u5728\u7a0b\u5e8fwp-includes\u76ee\u5f55theme.php\u4e2d\u589e\u52a0\u4e00\u4e2acustom-background \u6807\u7b7e\uff0c\u8fd9\u662f\u9020\u6210\u201c\u80cc\u666f\u201d\u529f\u80fd\u5931\u6548\u7684\u95ee\u9898\u6240\u5728\uff0c\u6253\u5f00theme.php\u7a0b\u5e8f\u6587\u4ef6\uff0c\u5728\u7b2c1797\u884c\u627e\u5230\uff1a<\/p>\n<p><code>body.custom-background { &lt;?php echo trim( $style ); ?&gt; }<\/code><\/p>\n<p>\u5220\u9664\u5176\u4e2d\u7684<span style=\"color: #993300;\"> .custom-background <\/span>\u53d8\u4e3a\uff1a<\/p>\n<p><code>body { &lt;?php echo trim( $style ); ?&gt; }<\/code><\/p>\n<p>\u6b64\u65b9\u6cd5\u9002\u5408\u6240\u6709\u4e4b\u524d\u652f\u6301\u201c\u80cc\u666f\u201d\u529f\u80fd\u7684\u4e3b\u9898\uff0c\u4f46\u9700\u4fee\u6539\u7a0b\u5e8f\u6587\u4ef6\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002<\/p>\n<p><strong>\u65b9\u6848\u4e8c<\/strong> \u8fd9\u662f\u6807\u51c6\u7684\u89e3\u51b3\u7684\u65b9\u6848\uff0c\u6253\u5f00\u9ed8\u8ba4\u4e3b\u9898Twenty Eleven\u7684header.php\u6a21\u7248\uff0c\u4f60\u4f1a\u53d1\u73b0\u6709\u4e00\u53e5\uff1a<\/p>\n<p><code>&lt;body &lt;?php body_class(); ?&gt;&gt;<\/code><\/p>\n<p>\u4ee3\u66ff\u4e86\u6b63\u5e38\u7684<span style=\"color: #993300;\">&lt;body&gt;<\/span>\u6807\u7b7e\uff0c\u8fd9\u662f\u5173\u952e\uff0c\u5c06\u4e0a\u9762\u7684\u4ee3\u7801\u66ff\u6362\u81ea\u5df1\u6240\u4f7f\u7528\u4e3b\u9898header.php\u6a21\u677f<span style=\"color: #993300;\">&lt;body&gt;<\/span>\u6807\u7b7e\u5373\u53ef\u3002<\/p>\n<p><strong>\u65b9\u6848\u4e09<\/strong> \u7528<\/p>\n<p><code>&lt;body class=\"custom-background\"&gt;<\/code><\/p>\n<p>\u66ff\u6362header.php\u6a21\u7248<span style=\"color: #800000;\">&lt;body&gt;<\/span>\u6807\u7b7e\uff0c\u4e0d\u8ba9\u5176\u589e\u52a0\u989d\u5916\u7684\u6807\u7b7e\uff0c\u6b64\u65b9\u6cd5\u65b9\u4fbf\u5b9e\u7528\uff0c\u9002\u5408\u6240\u6709\u4e3b\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740WordPress 3.3\u6b63\u5f0f\u7248\u7684\u53d1\u5e03\uff0c\u5f88\u591a\u76c6\u53cb\u90fd\u5728\u7b2c\u4e00\u65f6\u95f4\u5c06\u7a0b\u5e8f\u5347\u7ea7\u5230\u6700\u65b0\u7248\uff0c\u4e0d\u8fc7\u5f88\u5feb\u53d1\u73b0\u67d0\u4e9b\u5177\u5907\u201c\u80cc\u666f\u201d\u529f\u80fd\u7684\u4e3b\u9898\uff08\u5305\u62ec HotNews\u4e3b\u9898\uff09\u4e4b\u524d\u8bbe\u7f6e\u7684\u80cc\u666f\u5931\u6548\u4e86\u3002 WordPress\u65e9\u57282.8\u7248\u5c31\u589e\u52a0\u4e86\u81ea\u5b9a\u4e49\u80cc\u666fbody_class()\u51fd\u6570\uff0c\u76f4\u52303.0\u7248\u624d\u5728\u9ed8\u8ba4\u4e3b\u9898\u4e2d\u589e\u52a0\u4e86\u201c\u80cc\u666f\u201d\u529f\u80fd\uff0c\u5177\u5907\u6b64\u529f\u80fd\u7684\u4e3b \u9898\u4e5f\u4e0d\u662f\u5f88\u591a\uff0c\u53ef\u80fd\u5927\u90e8\u5206\u4e3b\u9898\u8bbe\u8ba1\u8005\u4f1a\u89c9\u5f97\u8fd9\u4e2a\u529f\u80fd\u6709\u4e9b\u9e21\u808b\uff0c\u7b80\u5355\u901a\u8fc7\u4fee\u6539CSS\u6837\u5f0f\u5c31\u53ef\u5b9e\u73b0\u7684\u529f\u80fd\uff0c\u6ca1\u6709\u5fc5\u8981\u589e\u52a0\u4e00\u6b21\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u4f46\u8fd9\u53e5 body_class()\u51fd\u6570\u521d\u8877\uff0c\u5e76\u4e0d\u662f\u4e3a\u4e86\u7b80\u5355\u66f4\u6362\u6574\u4e2a\u7ad9\u70b9\u6240\u6709\u9875\u9762\u7684\u80cc\u666f\uff0c\u800c\u662f\u65b9\u4fbf\u8bbe\u8ba1\u4eba\u5458\u7075\u6d3b\u7684\u63a7\u5236\u4e0d\u540c\u9875\u9762\u4e2d\u5404\u4e2a\u5143\u7d20\u6837\u5f0f\uff0c\u5927\u9053\u7406\u4e0d\u8bf4\u4e86\uff0c\u4e0b\u9762 \u8bf4\u4e00\u4e0b\u5177\u4f53\u7684\u89e3\u51b3\u65b9\u6848\uff1a \u65b9\u6848\u4e00 WordPress 3.3\u7248\u5728\u7a0b\u5e8fwp-includes\u76ee\u5f55theme.php\u4e2d\u589e\u52a0\u4e00\u4e2acustom-background \u6807\u7b7e\uff0c\u8fd9\u662f\u9020\u6210\u201c\u80cc\u666f\u201d\u529f\u80fd\u5931\u6548\u7684\u95ee\u9898\u6240\u5728\uff0c\u6253\u5f00theme.php\u7a0b\u5e8f\u6587\u4ef6\uff0c\u5728\u7b2c1797\u884c\u627e\u5230\uff1a body.custom-background { &lt;?php echo trim( $style ); ?&gt; } \u5220\u9664\u5176\u4e2d\u7684 .custom-background \u53d8\u4e3a\uff1a body { &lt;?php echo trim( $style ); ?&gt; } \u6b64\u65b9\u6cd5\u9002\u5408\u6240\u6709\u4e4b\u524d\u652f\u6301\u201c\u80cc\u666f\u201d\u529f\u80fd\u7684\u4e3b\u9898\uff0c\u4f46\u9700\u4fee\u6539\u7a0b\u5e8f\u6587\u4ef6\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002 \u65b9\u6848\u4e8c \u8fd9\u662f\u6807\u51c6\u7684\u89e3\u51b3\u7684\u65b9\u6848\uff0c\u6253\u5f00\u9ed8\u8ba4\u4e3b\u9898Twenty Eleven\u7684header.php\u6a21\u7248\uff0c\u4f60\u4f1a\u53d1\u73b0\u6709\u4e00\u53e5\uff1a &lt;body &lt;?php body_class(); ?&gt;&gt; \u4ee3\u66ff\u4e86\u6b63\u5e38\u7684&lt;body&gt;\u6807\u7b7e\uff0c\u8fd9\u662f\u5173\u952e\uff0c\u5c06\u4e0a\u9762\u7684\u4ee3\u7801\u66ff\u6362\u81ea\u5df1\u6240\u4f7f\u7528\u4e3b\u9898header.php\u6a21\u677f&lt;body&gt;\u6807\u7b7e\u5373\u53ef\u3002 \u65b9\u6848\u4e09 \u7528 &lt;body class=&#8221;custom-background&#8221;&gt; \u66ff\u6362header.php\u6a21\u7248&lt;body&gt;\u6807\u7b7e\uff0c\u4e0d\u8ba9\u5176\u589e\u52a0\u989d\u5916\u7684\u6807\u7b7e\uff0c\u6b64\u65b9\u6cd5\u65b9\u4fbf\u5b9e\u7528\uff0c\u9002\u5408\u6240\u6709\u4e3b\u9898\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[654],"class_list":["post-2305","post","type-post","status-publish","format-standard","hentry","category-wordpress-deepin","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/2305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2305"}],"version-history":[{"count":0,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/2305\/revisions"}],"wp:attachment":[{"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}