{"id":3007,"date":"2023-10-22T12:43:40","date_gmt":"2023-10-22T04:43:40","guid":{"rendered":"https:\/\/wpeyes.com\/wordpress\/?p=3007"},"modified":"2023-10-22T12:43:53","modified_gmt":"2023-10-22T04:43:53","slug":"%e5%a6%82%e4%bd%95%e4%b8%ba%e6%af%8f%e4%b8%aa-wordpress-%e5%b8%96%e5%ad%90%e8%ae%be%e7%bd%ae%e4%b8%8d%e5%90%8c%e7%9a%84%e6%a0%b7%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/wpeyes.com\/wordpress\/archives\/3007","title":{"rendered":"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f"},"content":{"rendered":"\n<p>\u60a8\u662f\u5426\u9047\u5230\u8fc7\u535a\u5ba2\u6587\u7ae0\u98ce\u683c\u4e0d\u540c\u7684\u7f51\u7ad9\uff1f\u6709\u4e9b\u7f51\u7ad9\u7684\u7f6e\u9876\u5e16\u5b50\u4ee5\u81ea\u5b9a\u4e49\u80cc\u666f\u7a81\u51fa\u663e\u793a\uff0c\u800c\u5176\u4ed6\u7f51\u7ad9\u53ef\u80fd\u6bcf\u4e2a\u7c7b\u522b\u7684\u5e16\u5b50\u90fd\u5177\u6709\u72ec\u7279\u7684\u5916\u89c2\u3002\u5982\u679c\u60a8\u60f3\u5b66\u4e60\u5982\u4f55\u4ee5\u4e0d\u540c\u7684\u65b9\u5f0f\u8bbe\u7f6e\u6bcf\u4e2a WordPress \u5e16\u5b50\u7684\u6837\u5f0f\uff0c\u90a3\u4e48\u60a8\u6765\u5bf9\u5730\u65b9\u4e86\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u60a8\u5c55\u793a\u5982\u4f55\u4ee5\u4e0d\u540c\u7684\u65b9\u5f0f\u8bbe\u7f6e\u6bcf\u4e2a WordPress \u5e16\u5b50\u7684\u6837\u5f0f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2017\/07\/postclasses.png\" alt=\"\u6bcf\u4e2a\u5e16\u5b50\u7684\u98ce\u683c\u5404\u4e0d\u76f8\u540c\" class=\"wp-image-45758\" title=\"\u6bcf\u4e2a\u5e16\u5b50\u7684\u98ce\u683c\u5404\u4e0d\u76f8\u540c\"\/><\/figure>\n\n\n\n<p>\u6ce8\u610f\uff1a\u672c\u6559\u7a0b\u8981\u6c42\u60a8<a href=\"https:\/\/www.wpbeginner.com\/plugins\/how-to-easily-add-custom-css-to-your-wordpress-site\/\">\u5728 WordPress \u4e2d\u6dfb\u52a0\u81ea\u5b9a\u4e49 CSS<\/a>\u3002\u60a8\u8fd8\u9700\u8981\u80fd\u591f<a href=\"https:\/\/www.wpbeginner.com\/wp-tutorials\/basics-of-inspect-element-with-your-wordpress-site\/\">\u4f7f\u7528\u68c0\u67e5\u5de5\u5177<\/a>\u3002\u9700\u8981\u4e00\u4e9b\u57fa\u672c\u7684<a href=\"https:\/\/www.wpbeginner.com\/glossary\/css\/\">CSS\u548c HTML \u77e5\u8bc6\u3002<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5728 WordPress \u4e2d\u8bbe\u7f6e\u5355\u4e2a\u5e16\u5b50\u7684\u6837\u5f0f<\/h4>\n\n\n\n<p>WordPress<a href=\"https:\/\/www.wpbeginner.com\/wp-themes\/default-wordpress-generated-css-cheat-sheet-for-beginners\/\">\u5c06\u9ed8\u8ba4 CSS \u7c7b\u6dfb\u52a0<\/a>\u5230\u60a8\u7f51\u7ad9\u4e0a\u7684\u5404\u79cd\u5143\u7d20\u3002\u7b26\u5408\u6807\u51c6\u7684 WordPress \u4e3b\u9898\u5fc5\u987b\u5177\u6709 WordPress \u6240\u9700\u7684\u4ee3\u7801\uff0c\u4ee5\u4fbf\u4e3a\u6b63\u6587\u3001\u5e16\u5b50\u3001\u9875\u9762\u3001\u5c0f\u90e8\u4ef6\u3001\u83dc\u5355\u7b49\u6dfb\u52a0 CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u4e3b\u9898\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a WordPress \u7684\u6838\u5fc3\u51fd\u6570<code>post_class()<\/code>\u6765\u544a\u8bc9 WordPress \u5728\u54ea\u91cc\u6dfb\u52a0\u5e16\u5b50\u7684\u9ed8\u8ba4 CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u8bbf\u95ee\u60a8\u7684\u7f51\u7ad9\u5e76\u4f7f\u7528\u6d4f\u89c8\u5668\u4e2d\u7684\u68c0\u67e5\u5de5\u5177\uff0c\u90a3\u4e48\u60a8\u5c06\u80fd\u591f\u770b\u5230\u4e3a\u6bcf\u4e2a\u5e16\u5b50\u6dfb\u52a0\u7684\u8fd9\u4e9b\u7c7b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2017\/07\/defaultcssclasses.png\" alt=\"WordPress \u5e16\u5b50\u7684\u9ed8\u8ba4 CSS \u7c7b\" class=\"wp-image-45643\" title=\"WordPress \u5e16\u5b50\u7684\u9ed8\u8ba4 CSS \u7c7b\"\/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u6839\u636e\u7528\u6237\u6b63\u5728\u67e5\u770b\u7684\u9875\u9762\u9ed8\u8ba4\u6dfb\u52a0\u7684 CSS \u7c7b\u3002<\/p>\n\n\n\n<ul>\n<li>.post-id<\/li>\n\n\n\n<li>\u3002\u90ae\u653f<\/li>\n\n\n\n<li>\u3002\u4f9d\u604b<\/li>\n\n\n\n<li>\u3002\u9ecf<\/li>\n\n\n\n<li>.hentry\uff08hAtom \u5fae\u683c\u5f0f\u9875\u9762\uff09<\/li>\n\n\n\n<li>.\u7c7b\u522bID<\/li>\n\n\n\n<li>\u3002\u5206\u7c7b\u540d\u79f0<\/li>\n\n\n\n<li>\u3002\u6807\u7b7e\u540d<\/li>\n\n\n\n<li>.format-{\u683c\u5f0f\u540d\u79f0}<\/li>\n\n\n\n<li>.type-{\u5e16\u5b50\u7c7b\u578b\u540d\u79f0}<\/li>\n\n\n\n<li>.has-post-thumbnail<\/li>\n\n\n\n<li>.post-password-required<\/li>\n\n\n\n<li>.\u540e\u5bc6\u7801\u4fdd\u62a4<\/li>\n<\/ul>\n\n\n\n<p>\u793a\u4f8b\u8f93\u51fa\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>&lt;<\/code><code>article<\/code><code>id<\/code><code>=<\/code><code>\"post-412\"<\/code><code>class<\/code><code>=<\/code><code>\"post-412 post type-post status-publish format-standard hentry category-news\"<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u76f8\u5e94\u7684 CSS \u7c7b\u5bf9\u6bcf\u4e2a WordPress \u5e16\u5b50\u8fdb\u884c\u4e0d\u540c\u7684\u6837\u5f0f\u8bbe\u7f6e\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u60f3\u8bbe\u7f6e\u5355\u4e2a\u5e16\u5b50\u7684\u6837\u5f0f\uff0c\u5219\u53ef\u4ee5\u5728\u81ea\u5b9a\u4e49 CSS \u4e2d\u4f7f\u7528 post-id \u7c7b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1234<\/td><td><code>.post<\/code><code>-412<\/code><code>{ <\/code><code>background-color<\/code><code>: <\/code><code>#FF0303<\/code><code>;<\/code><code>color<\/code><code>:<\/code><code>#FFFFFF<\/code><code>; <\/code><code>}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u4e0d\u8981\u5fd8\u8bb0\u66f4\u6539\u5e16\u5b50 ID \u4ee5\u5339\u914d\u60a8\u81ea\u5df1\u7684\u5e16\u5b50 ID\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2017\/07\/styleindividualpost.png\" alt=\"\u5728 WordPress \u4e2d\u8bbe\u7f6e\u7279\u5b9a\u5e16\u5b50\u7684\u6837\u5f0f\" class=\"wp-image-45645\" title=\"\u5728 WordPress \u4e2d\u8bbe\u7f6e\u7279\u5b9a\u5e16\u5b50\u7684\u6837\u5f0f\"\/><\/figure>\n\n\n\n<p>\u8ba9\u6211\u4eec\u770b\u53e6\u4e00\u4e2a\u4f8b\u5b50\u3002<\/p>\n\n\n\n<p>\u8fd9\u6b21\uff0c\u6211\u4eec\u5c06\u5bf9\u5728\u79f0\u4e3a\u65b0\u95fb\u7684\u7279\u5b9a\u7c7b\u522b\u4e0b\u5f52\u6863\u7684\u6240\u6709\u5e16\u5b50\u8fdb\u884c\u6837\u5f0f\u8bbe\u7f6e\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5c06\u4ee5\u4e0b\u81ea\u5b9a\u4e49 CSS \u6dfb\u52a0\u5230\u6211\u4eec\u7684\u4e3b\u9898\u6765\u505a\u5230\u8fd9\u4e00\u70b9\u201d<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1234<\/td><td><code>.category-news { <\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>font-size<\/code><code>: <\/code><code>18px<\/code><code>;<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>font-style<\/code><code>: <\/code><code>italic<\/code><code>;<\/code><code>}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u6b64 CSS \u5c06\u5f71\u54cd\u65b0\u95fb\u7c7b\u522b\u4e0b\u63d0\u4ea4\u7684\u6240\u6709\u5e16\u5b50\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bfe\u540e\u529f\u80fd<\/h4>\n\n\n\n<p>\u4e3b\u9898\u5f00\u53d1\u4eba\u5458\u4f7f\u7528 post_class \u51fd\u6570\u544a\u8bc9 WordPress \u5728\u54ea\u91cc\u6dfb\u52a0\u5e16\u5b50\u7c7b\u3002\u901a\u5e38\u5b83\u5728<code>&lt;article&gt;<\/code>\u6807\u7b7e\u4e2d\u3002<\/p>\n\n\n\n<p>post class \u51fd\u6570\u4e0d\u4ec5\u52a0\u8f7d\u9ed8\u8ba4\u7684 WordPress \u751f\u6210\u7684 CSS \u7c7b\uff0c\u8fd8\u5141\u8bb8\u60a8\u6dfb\u52a0\u81ea\u5df1\u7684\u7c7b\u3002<\/p>\n\n\n\n<p>\u6839\u636e\u60a8\u7684\u4e3b\u9898\uff0c\u60a8\u5c06\u5728 single.php \u6587\u4ef6\u6216\u5185\u5bb9\u6a21\u677f\u6587\u4ef6\u4e2d\u627e\u5230 post_class \u51fd\u6570\u3002\u901a\u5e38\uff0c\u4ee3\u7801\u770b\u8d77\u6765\u50cf\u8fd9\u6837\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>&lt;article id=<\/code><code>\"post-&lt;?php the_ID(); ?&gt;\"<\/code><code>&lt;?php post_class(); ?&gt;&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u5c5e\u6027\u6dfb\u52a0\u81ea\u5df1\u7684\u81ea\u5b9a\u4e49 CSS \u7c7b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>&lt;article id=<\/code><code>\"post-&lt;?php the_ID(); ?&gt;\"<\/code><code>&lt;?php post_class(<\/code><code>'longform-article'<\/code><code>); ?&gt;&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>post_class \u5c06\u6253\u5370\u51fa\u76f8\u5e94\u7684\u9ed8\u8ba4 CSS \u7c7b\u4ee5\u53ca\u60a8\u7684\u81ea\u5b9a\u4e49 CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u60f3\u6dfb\u52a0\u591a\u4e2aCSS\u7c7b\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u5c06\u5b83\u4eec\u5b9a\u4e49\u4e3a\u4e00\u4e2a\u6570\u7ec4\uff0c\u7136\u540e\u5728post_class\u51fd\u6570\u4e2d\u8c03\u7528\u5b83\u4eec\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12345678<\/td><td><code>&lt;?php <\/code><code>$custom_classes<\/code><code>= <\/code><code>array<\/code><code>(<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>'longform-article'<\/code><code>,<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>'featured-story'<\/code><code>,<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>'interactive'<\/code><code>,<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>);<\/code><code>?&gt;<\/code><code>&lt;article id=<\/code><code>\"post-&lt;?php the_ID(); ?&gt;\"<\/code><code>&lt;?php post_class( <\/code><code>$custom_classes<\/code><code>); ?&gt;&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u6839\u636e\u4f5c\u8005\u7684\u4e0d\u540c\u98ce\u683c\u5e16\u5b50\u4e5f\u4e0d\u540c<\/h4>\n\n\n\n<p>the_posts \u51fd\u6570\u751f\u6210\u7684\u9ed8\u8ba4 CSS \u7c7b\u4e0d\u5305\u542b\u4f5c\u8005\u59d3\u540d\u4f5c\u4e3a CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u60f3\u6839\u636e\u4f5c\u8005\u81ea\u5b9a\u4e49\u6bcf\u4e2a\u5e16\u5b50\u7684\u6837\u5f0f\uff0c\u90a3\u4e48\u60a8\u9700\u8981\u9996\u5148\u5c06\u4f5c\u8005\u59d3\u540d\u6dfb\u52a0\u4e3a CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u7247\u6bb5\u6765\u5b8c\u6210\u6b64\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td><code>&lt;?php <\/code><code>$author<\/code><code>= get_the_author_meta(<\/code><code>'user_nicename'<\/code><code>); ?&gt;<\/code><code>&lt;article id=<\/code><code>\"post-&lt;?php the_ID(); ?&gt;\"<\/code><code>&lt;?php post_class( <\/code><code>$author<\/code><code>); ?&gt;&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u6b64\u4ee3\u7801\u4f1a\u5c06\u7528\u6237\u7684\u597d\u540d\u5b57\u6dfb\u52a0\u4e3a CSS \u7c7b\u3002Nicename \u662f WordPress \u4f7f\u7528\u7684 URL \u53cb\u597d\u540d\u79f0\u3002\u5b83\u6ca1\u6709\u7a7a\u683c\uff0c\u5e76\u4e14\u6240\u6709\u5b57\u7b26\u90fd\u662f\u5c0f\u5199\uff0c\u8fd9\u4f7f\u5f97\u5b83\u975e\u5e38\u9002\u5408\u7528\u4f5c CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u4e0a\u9762\u7684\u4ee3\u7801\u5c06\u4e3a\u60a8\u63d0\u4f9b\u5982\u4e0b\u8f93\u51fa\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>&lt;article id=<\/code><code>\"post-412\"<\/code><code>class<\/code><code>=<\/code><code>\"peter post-412 post type-post status-publish format-standard hentry category-news\"<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u5728\u81ea\u5b9a\u4e49 CSS \u4e2d\u4f7f\u7528 .peter \u6765\u8bbe\u7f6e\u8be5\u7279\u5b9a\u4f5c\u8005\u7684\u6240\u6709\u5e16\u5b50\u7684\u6837\u5f0f\uff0c\u4f7f\u5176\u770b\u8d77\u6765\u6709\u6240\u4e0d\u540c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1234<\/td><td><code>.peter { <\/code><code>background-color<\/code><code>:<\/code><code>#EEE<\/code><code>;<\/code><code>border<\/code><code>:<\/code><code>1px<\/code><code>solid<\/code><code>#CCC<\/code><code>; <\/code><code>}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4f7f\u7528\u8bc4\u8bba\u8ba1\u6570\u6839\u636e\u53d7\u6b22\u8fce\u7a0b\u5ea6\u5bf9\u5e16\u5b50\u8fdb\u884c\u6837\u5f0f\u8bbe\u7f6e<\/h4>\n\n\n\n<p>\u60a8\u53ef\u80fd\u89c1\u8fc7\u5e26\u6709<a href=\"https:\/\/www.wpbeginner.com\/plugins\/5-best-popular-posts-plugins-for-wordpress\/\">\u70ed\u95e8\u5e16\u5b50\u5c0f\u90e8\u4ef6\u7684<\/a>\u7f51\u7ad9\uff0c\u8fd9\u4e9b\u5c0f\u90e8\u4ef6\u6709\u65f6\u57fa\u4e8e\u8bc4\u8bba\u8ba1\u6570\u3002\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5c06\u5411\u60a8\u5c55\u793a\u5982\u4f55\u4f7f\u7528\u8bc4\u8bba\u8ba1\u6570\u4ee5\u4e0d\u540c\u7684\u65b9\u5f0f\u8bbe\u7f6e\u5e16\u5b50\u6837\u5f0f\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u83b7\u53d6\u8bc4\u8bba\u6570\u5e76\u5c06\u5176\u5173\u8054\u5230\u4e00\u4e2a\u7c7b\u3002<\/p>\n\n\n\n<p>\u8981\u83b7\u53d6\u8bc4\u8bba\u8ba1\u6570\uff0c\u60a8\u9700\u8981\u5728\u4e3b\u9898\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\u3002\u6b64\u4ee3\u7801\u4f4d\u4e8e<a href=\"https:\/\/www.wpbeginner.com\/glossary\/loop\/\">WordPress \u5faa\u73af<\/a>\u5185\uff0c\u56e0\u6b64\u60a8\u4e5f\u53ef\u4ee5\u5c06\u5176\u6dfb\u52a0\u5230 &lt;article&gt; \u6807\u8bb0\u4e4b\u524d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>123456789101112<\/td><td><code>&lt;?php <\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>$postid<\/code><code>= get_the_ID();<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>$total_comment_count<\/code><code>= wp_count_comments(<\/code><code>$postid<\/code><code>);<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>$my_comment_count<\/code><code>= <\/code><code>$total_comment_count<\/code><code>-&gt;approved;<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>if<\/code><code>(<\/code><code>$my_comment_count<\/code><code>&lt;10) {<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>$my_comment_count<\/code><code>= <\/code><code>'new'<\/code><code>;<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>} <\/code><code>elseif<\/code><code>(<\/code><code>$my_comment_count<\/code><code>&gt;= 10 &amp;&amp; <\/code><code>$my_comment_count<\/code><code>&lt;20) {<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>$my_comment_count<\/code><code>= <\/code><code>'emerging'<\/code><code>;<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>} <\/code><code>elseif<\/code><code>(<\/code><code>$my_comment_count<\/code><code>&gt;= 20) {<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>$my_comment_count<\/code><code>= <\/code><code>'popular'<\/code><code>;<\/code><code>&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code>}<\/code><code>?&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u6b64\u4ee3\u7801\u68c0\u67e5\u6b63\u5728\u663e\u793a\u7684\u5e16\u5b50\u7684\u8bc4\u8bba\u8ba1\u6570\uff0c\u5e76\u6839\u636e\u8ba1\u6570\u4e3a\u5176\u5206\u914d\u4e00\u4e2a\u503c\u3002\u4f8b\u5982\uff0c\u8bc4\u8bba\u6570\u5c11\u4e8e 10 \u6761\u7684\u5e16\u5b50\u4f1a\u88ab\u5f52\u7c7b\u4e3a\u201c\u65b0\u201d\uff0c\u5c11\u4e8e 20 \u6761\u7684\u5e16\u5b50\u88ab\u79f0\u4e3a\u201c\u65b0\u5174\u201d\uff0c\u800c\u8bc4\u8bba\u6570\u8d85\u8fc7 20 \u6761\u7684\u5e16\u5b50\u5219\u88ab\u79f0\u4e3a\u201c\u70ed\u95e8\u201d\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u60a8\u9700\u8981\u5c06\u8bc4\u8bba\u8ba1\u6570 CSS \u7c7b\u6dfb\u52a0\u5230 post_class \u51fd\u6570\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>&lt;article id=<\/code><code>\"post-&lt;?php the_ID(); ?&gt;\"<\/code><code>&lt;?php post_class( <\/code><code>$my_comment_count<\/code><code>); ?&gt;&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u8fd9\u5c06\u6839\u636e\u6bcf\u4e2a\u5e16\u5b50\u7684\u8bc4\u8bba\u6570\u91cf\u5411\u6240\u6709\u5e16\u5b50\u6dfb\u52a0\u65b0\u7684\u3001\u65b0\u5174\u7684\u548c\u6d41\u884c\u7684 CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u6839\u636e\u53d7\u6b22\u8fce\u7a0b\u5ea6\u6dfb\u52a0\u81ea\u5b9a\u4e49 CSS \u6765\u8bbe\u7f6e\u5e16\u5b50\u6837\u5f0f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>123<\/td><td><code>.new {<\/code><code>border<\/code><code>: <\/code><code>1px<\/code><code>solid<\/code><code>#FFFF00<\/code><code>;}<\/code><code>.emerging {<\/code><code>border<\/code><code>: <\/code><code>1px<\/code><code>dashed<\/code><code>#FF9933<\/code><code>;}<\/code><code>.popular {<\/code><code>border<\/code><code>: <\/code><code>1px<\/code><code>dashed<\/code><code>#CC0000<\/code><code>;}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u6211\u4eec\u53ea\u662f\u6dfb\u52a0\u8fb9\u6846\uff0c\u60a8\u53ef\u4ee5\u6dfb\u52a0\u4efb\u4f55\u60a8\u60f3\u8981\u7684 CSS \u89c4\u5219\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u57fa\u4e8e\u81ea\u5b9a\u4e49\u5b57\u6bb5\u7684\u5e16\u5b50\u6837\u5f0f<\/h4>\n\n\n\n<p>\u4e3b\u9898\u6587\u4ef6\u4e2d\u7684\u786c\u7f16\u7801 CSS \u7c7b\u9650\u5236\u60a8\u53ea\u80fd\u4f7f\u7528\u90a3\u4e9b\u7279\u5b9a\u7684 CSS \u7c7b\u3002\u5982\u679c\u60a8\u60f3\u5728\u64b0\u5199\u6587\u7ae0\u65f6\u51b3\u5b9a\u5c06\u54ea\u4e2a CSS \u7c7b\u6dfb\u52a0\u5230\u6587\u7ae0\u4e2d\uff0c\u8be5\u600e\u4e48\u529e\uff1f<\/p>\n\n\n\n<p>\u4f7f\u7528<a href=\"https:\/\/www.wpbeginner.com\/wp-tutorials\/wordpress-custom-fields-101-tips-tricks-and-hacks\/\">\u81ea\u5b9a\u4e49\u5b57\u6bb5<\/a>\uff0c\u60a8\u53ef\u4ee5\u52a8\u6001\u6dfb\u52a0 CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5411\u5e16\u5b50\u6dfb\u52a0\u81ea\u5b9a\u4e49\u5b57\u6bb5\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u5bf9\u5176\u8fdb\u884c\u6d4b\u8bd5\u3002\u7f16\u8f91\u5e16\u5b50\u5e76\u5411\u4e0b\u6eda\u52a8\u5230\u81ea\u5b9a\u4e49\u5b57\u6bb5\u90e8\u5206\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2017\/07\/addcustomfield.png\" alt=\"\u6dfb\u52a0\u5e16\u5b50\u7c7b\u522b\u4f5c\u4e3a\u81ea\u5b9a\u4e49\u5b57\u6bb5\" class=\"wp-image-45647\" title=\"\u6dfb\u52a0\u5e16\u5b50\u7c7b\u522b\u4f5c\u4e3a\u81ea\u5b9a\u4e49\u5b57\u6bb5\"\/><\/figure>\n\n\n\n<p>\u6dfb\u52a0 post-class \u4f5c\u4e3a\u81ea\u5b9a\u4e49\u5b57\u6bb5\u540d\u79f0\uff0c\u4ee5\u53ca\u60a8\u60f3\u8981\u5728\u503c\u5b57\u6bb5\u4e2d\u7528\u4f5c CSS \u7c7b\u7684\u4efb\u4f55\u5185\u5bb9\u3002<\/p>\n\n\n\n<p>\u4e0d\u8981\u5fd8\u8bb0\u5355\u51fb\u201c\u6dfb\u52a0\u81ea\u5b9a\u4e49\u5b57\u6bb5\u201d\u6309\u94ae\u6765\u5b58\u50a8\u5b83\uff0c\u7136\u540e\u4fdd\u5b58\u60a8\u7684\u5e16\u5b50\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u7f16\u8f91\u4e3b\u9898\u6587\u4ef6\u4ee5\u5c06\u81ea\u5b9a\u4e49\u5b57\u6bb5\u663e\u793a\u4e3a\u5e16\u5b50\u7c7b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td><code>&lt;?php <\/code><code>$custom_values<\/code><code>= get_post_meta(<\/code><code>$post<\/code><code>-&gt;ID, <\/code><code>'post-class'<\/code><code>); ?&gt;<\/code><code>&lt;article id=<\/code><code>\"post-&lt;?php the_ID(); ?&gt;\"<\/code><code>&lt;?php post_class( <\/code><code>$custom_values<\/code><code>); ?&gt;&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u5b83\u5c06\u8f93\u51fa\u4ee5\u4e0b HTML\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>&lt;article id=<\/code><code>\"post-412\"<\/code><code>class<\/code><code>=<\/code><code>\"trending post-412 post type-post status-publish format-standard hentry category-uncategorized\"<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u60a8\u73b0\u5728\u53ef\u4ee5\u4e3a\u4f7f\u7528\u81ea\u5b9a\u4e49\u5b57\u6bb5\u6dfb\u52a0\u7684 post_class \u6dfb\u52a0\u81ea\u5b9a\u4e49 CSS\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>123<\/td><td><code>.trending{<\/code><code>background-color<\/code><code>:#<\/code><code>#ff0000<\/code><code>;<\/code><code>}<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/wpcode.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">WPCode\u4e0e \u2764\ufe0f \u4e3b\u529e<\/a><\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/library.wpcode.com\/use-snippet\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u5728 WordPress \u4e2d\u4e00\u952e\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u81ea\u5b9a\u4e49\u5b57\u6bb5\u53ef\u4ee5\u6709\u591a\u4e2a\u503c\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u540d\u79f0\u6dfb\u52a0\u591a\u4e2a CSS \u7c7b\u3002<\/p>\n\n\n\n<p>\u8fd8\u6709\u5f88\u591a\u65b9\u6cd5\u53ef\u4ee5\u5355\u72ec\u8bbe\u7f6e WordPress \u5e16\u5b50\u7684\u6837\u5f0f\u3002\u968f\u7740\u60a8\u6280\u80fd\u7684\u589e\u957f\uff0c\u60a8\u5c06\u4e0d\u65ad\u53d1\u73b0\u4f7f\u7528\u4e0d\u540c\u6761\u4ef6\u8bbe\u8ba1\u5e16\u5b50\u6837\u5f0f\u7684\u65b0\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u60a8\u4e86\u89e3\u5982\u4f55\u4ee5\u4e0d\u540c\u7684\u65b9\u5f0f\u8bbe\u7f6e\u6bcf\u4e2a WordPress \u5e16\u5b50\u7684\u6837\u5f0f\u3002\u60a8\u53ef\u80fd\u8fd8\u60f3\u67e5\u770b\u6211\u4eec<a href=\"https:\/\/www.wpbeginner.com\/wp-tutorials\/55-most-wanted-wordpress-tips-tricks-and-hacks\/\">\u6700\u60f3\u8981\u7684 WordPress \u63d0\u793a\u3001\u6280\u5de7\u548c\u6280\u5de7<\/a>\u7684\u6700\u7ec8\u5217\u8868\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u60a8\u662f\u5426\u9047\u5230\u8fc7\u535a\u5ba2\u6587\u7ae0\u98ce\u683c\u4e0d\u540c\u7684\u7f51\u7ad9\uff1f\u6709\u4e9b\u7f51\u7ad9\u7684\u7f6e\u9876\u5e16\u5b50\u4ee5\u81ea\u5b9a\u4e49\u80cc\u666f\u7a81\u51fa\u663e\u793a\uff0c\u800c\u5176\u4ed6\u7f51\u7ad9\u53ef\u80fd\u6bcf\u4e2a\u7c7b\u522b\u7684\u5e16\u5b50\u90fd\u5177\u6709 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\"> <span class=\"screen-reader-text\">\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":3009,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[29],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f - WordPress\u4e2d\u6587<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f - WordPress\u4e2d\u6587\" \/>\n<meta property=\"og:description\" content=\"\u60a8\u662f\u5426\u9047\u5230\u8fc7\u535a\u5ba2\u6587\u7ae0\u98ce\u683c\u4e0d\u540c\u7684\u7f51\u7ad9\uff1f\u6709\u4e9b\u7f51\u7ad9\u7684\u7f6e\u9876\u5e16\u5b50\u4ee5\u81ea\u5b9a\u4e49\u80cc\u666f\u7a81\u51fa\u663e\u793a\uff0c\u800c\u5176\u4ed6\u7f51\u7ad9\u53ef\u80fd\u6bcf\u4e2a\u7c7b\u522b\u7684\u5e16\u5b50\u90fd\u5177\u6709 &hellip; \u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f Read More \u00bb\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\" \/>\n<meta property=\"og:site_name\" content=\"WordPress\u4e2d\u6587\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-22T04:43:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-22T04:43:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png\" \/>\n<meta name=\"author\" content=\"qmk\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"qmk\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007#article\",\"isPartOf\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\"},\"author\":{\"name\":\"qmk\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#\/schema\/person\/80e9903d893da74eb372a4c631f6e22c\"},\"headline\":\"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f\",\"datePublished\":\"2023-10-22T04:43:40+00:00\",\"dateModified\":\"2023-10-22T04:43:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\"},\"wordCount\":118,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#organization\"},\"articleSection\":[\"\u6700\u4f73\u4e3b\u9898\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wpeyes.com\/wordpress\/archives\/3007#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\",\"url\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\",\"name\":\"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f - WordPress\u4e2d\u6587\",\"isPartOf\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#website\"},\"datePublished\":\"2023-10-22T04:43:40+00:00\",\"dateModified\":\"2023-10-22T04:43:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpeyes.com\/wordpress\/archives\/3007\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/archives\/3007#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/wpeyes.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u535a\u6587\",\"item\":\"https:\/\/wpeyes.com\/wordpress\/archives\/category\/web-article\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"wpbeginner\",\"item\":\"https:\/\/wpeyes.com\/wordpress\/archives\/category\/web-article\/wpbeginner\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u6700\u4f73\u4e3b\u9898\",\"item\":\"https:\/\/wpeyes.com\/wordpress\/archives\/category\/web-article\/wpbeginner\/themes\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#website\",\"url\":\"https:\/\/wpeyes.com\/wordpress\/\",\"name\":\"WordPress\u4e2d\u6587\",\"description\":\"wpeyes\u6280\u672f\u89c6\u70b9\",\"publisher\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpeyes.com\/wordpress\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#organization\",\"name\":\"WordPress\u4e2d\u6587\",\"url\":\"https:\/\/wpeyes.com\/wordpress\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wpeyes.com\/wordpress\/wp-content\/uploads\/sites\/8\/2024\/01\/WordPress-logotype-wmark-white.png\",\"contentUrl\":\"https:\/\/wpeyes.com\/wordpress\/wp-content\/uploads\/sites\/8\/2024\/01\/WordPress-logotype-wmark-white.png\",\"width\":1000,\"height\":1000,\"caption\":\"WordPress\u4e2d\u6587\"},\"image\":{\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#\/schema\/person\/80e9903d893da74eb372a4c631f6e22c\",\"name\":\"qmk\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/wpeyes.com\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b6009682ec6e3b4264f67fa0e1da275c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b6009682ec6e3b4264f67fa0e1da275c?s=96&d=mm&r=g\",\"caption\":\"qmk\"},\"sameAs\":[\"https:\/\/wpeyes.com\"],\"url\":\"https:\/\/wpeyes.com\/wordpress\/archives\/author\/qmk\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f - WordPress\u4e2d\u6587","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpeyes.com\/wordpress\/archives\/3007","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f - WordPress\u4e2d\u6587","og_description":"\u60a8\u662f\u5426\u9047\u5230\u8fc7\u535a\u5ba2\u6587\u7ae0\u98ce\u683c\u4e0d\u540c\u7684\u7f51\u7ad9\uff1f\u6709\u4e9b\u7f51\u7ad9\u7684\u7f6e\u9876\u5e16\u5b50\u4ee5\u81ea\u5b9a\u4e49\u80cc\u666f\u7a81\u51fa\u663e\u793a\uff0c\u800c\u5176\u4ed6\u7f51\u7ad9\u53ef\u80fd\u6bcf\u4e2a\u7c7b\u522b\u7684\u5e16\u5b50\u90fd\u5177\u6709 &hellip; \u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f Read More \u00bb","og_url":"https:\/\/wpeyes.com\/wordpress\/archives\/3007","og_site_name":"WordPress\u4e2d\u6587","article_published_time":"2023-10-22T04:43:40+00:00","article_modified_time":"2023-10-22T04:43:53+00:00","og_image":[{"url":"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png"}],"author":"qmk","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png","twitter_misc":{"\u4f5c\u8005":"qmk","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpeyes.com\/wordpress\/archives\/3007#article","isPartOf":{"@id":"https:\/\/wpeyes.com\/wordpress\/archives\/3007"},"author":{"name":"qmk","@id":"https:\/\/wpeyes.com\/wordpress\/#\/schema\/person\/80e9903d893da74eb372a4c631f6e22c"},"headline":"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f","datePublished":"2023-10-22T04:43:40+00:00","dateModified":"2023-10-22T04:43:53+00:00","mainEntityOfPage":{"@id":"https:\/\/wpeyes.com\/wordpress\/archives\/3007"},"wordCount":118,"commentCount":0,"publisher":{"@id":"https:\/\/wpeyes.com\/wordpress\/#organization"},"articleSection":["\u6700\u4f73\u4e3b\u9898"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpeyes.com\/wordpress\/archives\/3007#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpeyes.com\/wordpress\/archives\/3007","url":"https:\/\/wpeyes.com\/wordpress\/archives\/3007","name":"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f - WordPress\u4e2d\u6587","isPartOf":{"@id":"https:\/\/wpeyes.com\/wordpress\/#website"},"datePublished":"2023-10-22T04:43:40+00:00","dateModified":"2023-10-22T04:43:53+00:00","breadcrumb":{"@id":"https:\/\/wpeyes.com\/wordpress\/archives\/3007#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpeyes.com\/wordpress\/archives\/3007"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpeyes.com\/wordpress\/archives\/3007#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/wpeyes.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"\u535a\u6587","item":"https:\/\/wpeyes.com\/wordpress\/archives\/category\/web-article"},{"@type":"ListItem","position":3,"name":"wpbeginner","item":"https:\/\/wpeyes.com\/wordpress\/archives\/category\/web-article\/wpbeginner"},{"@type":"ListItem","position":4,"name":"\u6700\u4f73\u4e3b\u9898","item":"https:\/\/wpeyes.com\/wordpress\/archives\/category\/web-article\/wpbeginner\/themes"},{"@type":"ListItem","position":5,"name":"\u5982\u4f55\u4e3a\u6bcf\u4e2a WordPress \u5e16\u5b50\u8bbe\u7f6e\u4e0d\u540c\u7684\u6837\u5f0f"}]},{"@type":"WebSite","@id":"https:\/\/wpeyes.com\/wordpress\/#website","url":"https:\/\/wpeyes.com\/wordpress\/","name":"WordPress\u4e2d\u6587","description":"wpeyes\u6280\u672f\u89c6\u70b9","publisher":{"@id":"https:\/\/wpeyes.com\/wordpress\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpeyes.com\/wordpress\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":"Organization","@id":"https:\/\/wpeyes.com\/wordpress\/#organization","name":"WordPress\u4e2d\u6587","url":"https:\/\/wpeyes.com\/wordpress\/","logo":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/wpeyes.com\/wordpress\/#\/schema\/logo\/image\/","url":"https:\/\/wpeyes.com\/wordpress\/wp-content\/uploads\/sites\/8\/2024\/01\/WordPress-logotype-wmark-white.png","contentUrl":"https:\/\/wpeyes.com\/wordpress\/wp-content\/uploads\/sites\/8\/2024\/01\/WordPress-logotype-wmark-white.png","width":1000,"height":1000,"caption":"WordPress\u4e2d\u6587"},"image":{"@id":"https:\/\/wpeyes.com\/wordpress\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/wpeyes.com\/wordpress\/#\/schema\/person\/80e9903d893da74eb372a4c631f6e22c","name":"qmk","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/wpeyes.com\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b6009682ec6e3b4264f67fa0e1da275c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b6009682ec6e3b4264f67fa0e1da275c?s=96&d=mm&r=g","caption":"qmk"},"sameAs":["https:\/\/wpeyes.com"],"url":"https:\/\/wpeyes.com\/wordpress\/archives\/author\/qmk"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",250,250,false],"thumbnail":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",150,150,false],"medium":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",250,250,false],"medium_large":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",250,250,false],"large":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",250,250,false],"1536x1536":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",250,250,false],"2048x2048":["https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2010\/09\/postclassesthumb.png",250,250,false]},"uagb_author_info":{"display_name":"qmk","author_link":"https:\/\/wpeyes.com\/wordpress\/archives\/author\/qmk"},"uagb_comment_info":5,"uagb_excerpt":"\u60a8\u662f\u5426\u9047\u5230\u8fc7\u535a\u5ba2\u6587\u7ae0\u98ce\u683c\u4e0d\u540c\u7684\u7f51\u7ad9\uff1f\u6709\u4e9b\u7f51\u7ad9\u7684\u7f6e\u9876\u5e16\u5b50\u4ee5\u81ea\u5b9a\u4e49\u80cc\u666f\u7a81\u51fa\u663e\u793a\uff0c\u800c\u5176\u4ed6\u7f51\u7ad9\u53ef\u80fd\u6bcf\u4e2a\u7c7b\u522b\u7684\u5e16\u5b50\u90fd\u5177\u6709&hellip;","_links":{"self":[{"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/posts\/3007"}],"collection":[{"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3007"}],"version-history":[{"count":1,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/posts\/3007\/revisions"}],"predecessor-version":[{"id":3008,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/posts\/3007\/revisions\/3008"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/media\/3009"}],"wp:attachment":[{"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpeyes.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}