{"id":169,"date":"2026-03-13T20:32:55","date_gmt":"2026-03-13T12:32:55","guid":{"rendered":"https:\/\/www.anutool.com\/?p=169"},"modified":"2026-03-13T20:32:55","modified_gmt":"2026-03-13T12:32:55","slug":"wordpress-%e5%88%a4%e6%96%ad%e7%94%a8%e6%88%b7%e6%98%af%e5%90%a6%e7%99%bb%e5%bd%95%ef%bc%88%e6%9c%80%e7%ae%80%e5%8d%95%e3%80%81%e6%9c%80%e6%a0%87%e5%87%86%e6%96%b9%e6%b3%95%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.anutool.com\/index.php\/2026\/03\/13\/wordpress-%e5%88%a4%e6%96%ad%e7%94%a8%e6%88%b7%e6%98%af%e5%90%a6%e7%99%bb%e5%bd%95%ef%bc%88%e6%9c%80%e7%ae%80%e5%8d%95%e3%80%81%e6%9c%80%e6%a0%87%e5%87%86%e6%96%b9%e6%b3%95%ef%bc%89\/","title":{"rendered":"WordPress \u5224\u65ad\u7528\u6237\u662f\u5426\u767b\u5f55\uff08\u6700\u7b80\u5355\u3001\u6700\u6807\u51c6\u65b9\u6cd5\uff09"},"content":{"rendered":"<div>\u6211\u73b0\u5728<strong>\u4e00\u6b65\u4e00\u6b65\u5e26\u4f60\u628a\u300c\u767b\u5f55\u72b6\u6001\u6587\u5b57\u300d\u653e\u5230\u7f51\u7ad9\u6700\u9876\u90e8<\/strong>\uff0c\u5168\u7a0b\u4e0d\u7528\u61c2\u4ee3\u7801\uff0c\u7167\u7740\u70b9\u5c31\u884c\uff0c<strong>5 \u5206\u949f\u641e\u5b9a<\/strong>\uff01<\/div>\n<div><\/div>\n<h1>\u7b2c\u4e00\u6b65\uff1a\u6253\u5f00\u4e3b\u9898\u7f16\u8f91\u9875\u9762<\/h1>\n<div><\/div>\n<ol>\n<li>\u767b\u5f55\u4f60\u7684 WordPress \u540e\u53f0<\/li>\n<li>\u5de6\u8fb9\u70b9 \u2192 <strong>\u5916\u89c2\uff08Appearance\uff09<\/strong><\/li>\n<li>\u518d\u70b9 \u2192 <strong>\u4e3b\u9898\u6587\u4ef6\u7f16\u8f91\u5668\uff08Theme File Editor\uff09<\/strong><\/li>\n<\/ol>\n<div><\/div>\n<h1>\u7b2c\u4e8c\u6b65\uff1a\u627e\u5230\u9876\u90e8\u6587\u4ef6 header.php<\/h1>\n<div><\/div>\n<div>\u53f3\u8fb9\u627e\u5230\u5e76\u70b9\u51fb\uff1a<\/p>\n<div><\/div>\n<p><strong>header.php<\/strong>\uff08\u9876\u90e8\u6587\u4ef6\uff09<\/div>\n<div><\/div>\n<h1>\u7b2c\u4e09\u6b65\uff1a\u627e\u5230 &lt;body&gt; \u6807\u7b7e<\/h1>\n<div><\/div>\n<div>\u5728\u4ee3\u7801\u91cc\u627e\u5230\u8fd9\u4e00\u884c\uff1a<\/p>\n<div><\/div>\n<p><code>&lt;body &lt;?php body_class(); ?&gt;<\/code><\/p>\n<div><\/div>\n<p>\u6216\u8005<\/p>\n<div><\/div>\n<p><code>&lt;body&gt;<\/code><\/div>\n<div><\/div>\n<h1>\u7b2c\u56db\u6b65\uff1a\u628a\u6211\u7684\u4ee3\u7801\u7c98\u8d34\u8fdb\u53bb<\/h1>\n<div><\/div>\n<div><strong>\u76f4\u63a5\u7c98\u8d34\u5728 &lt;body&gt; \u4e0b\u9762\u7b2c\u4e00\u884c<\/strong><\/div>\n<div><\/div>\n<h2>\u4f60\u76f4\u63a5\u590d\u5236\u8fd9\u6bb5\u4ee3\u7801\uff08\u5b8c\u7f8e\u7248\uff09<\/h2>\n<div><\/div>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"y16m8tz\">\n<div>php<\/div>\n<div><\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"1ny9t7p\"><\/div>\n<div tabindex=\"0\" aria-describedby=\"vdlcxmp\"><\/div>\n<div tabindex=\"0\" aria-describedby=\"x37l1zh\"><\/div>\n<div tabindex=\"0\" aria-describedby=\"3i9lxe9\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>&lt;?php\r\n\/\/ \u767b\u5f55\u72b6\u6001\u5224\u65ad\r\nif ( is_user_logged_in() ) {\r\n    $login_text = '\u60a8\u597d\uff0c\u5df2\u767b\u5f55 | &lt;a href=\"'.wp_logout_url().'\"&gt;\u9000\u51fa\u767b\u5f55&lt;\/a&gt;';\r\n} else {\r\n    $login_text = '&lt;a href=\"'.wp_login_url().'\"&gt;\u767b\u5f55&lt;\/a&gt; | &lt;a href=\"'.wp_registration_url().'\"&gt;\u6ce8\u518c&lt;\/a&gt;';\r\n}\r\n?&gt;\r\n\r\n&lt;!-- \u9876\u90e8\u767b\u5f55\u72b6\u6001\u680f --&gt;\r\n&lt;div style=\"background:#f5f5f5; padding:8px 20px; text-align:right; font-size:14px;\"&gt;\r\n    &lt;?php echo $login_text; ?&gt;\r\n&lt;\/div&gt;\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<h1>\u7b2c\u4e94\u6b65\uff1a\u4fdd\u5b58<\/h1>\n<div><\/div>\n<div>\u70b9\u9875\u9762\u5e95\u90e8\u7684 <strong>\u66f4\u65b0\u6587\u4ef6\uff08Update File\uff09<\/strong><\/div>\n<div><\/div>\n<hr \/>\n<div><\/div>\n<h1>\u5b8c\u6210\u6548\u679c<\/h1>\n<div><\/div>\n<div>\u2705 \u7f51\u7ad9<strong>\u6700\u9876\u90e8<\/strong>\u4f1a\u51fa\u73b0\u4e00\u6761\u7070\u8272\u5c0f\u680f<\/p>\n<div><\/div>\n<p>\u2705 <strong>\u5df2\u767b\u5f55<\/strong>\uff1a\u663e\u793a\u300c\u60a8\u597d\uff0c\u5df2\u767b\u5f55 | \u9000\u51fa\u767b\u5f55\u300d<\/p>\n<div><\/div>\n<p>\u2705 <strong>\u672a\u767b\u5f55<\/strong>\uff1a\u663e\u793a\u300c\u767b\u5f55 | \u6ce8\u518c\u300d<\/p>\n<div><\/div>\n<p>\u2705 \u81ea\u52a8\u5224\u65ad\uff0c\u4e0d\u7528\u4efb\u4f55\u63d2\u4ef6<\/p>\n<div><\/div>\n<p>\u2705 \u7535\u8111\u624b\u673a\u90fd\u9002\u914d<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u73b0\u5728\u4e00\u6b65\u4e00\u6b65\u5e26\u4f60\u628a\u300c\u767b\u5f55\u72b6\u6001\u6587\u5b57\u300d\u653e\u5230\u7f51\u7ad9\u6700\u9876\u90e8\uff0c\u5168\u7a0b\u4e0d\u7528\u61c2\u4ee3\u7801\uff0c\u7167\u7740\u70b9\u5c31\u884c\uff0c5 \u5206\u949f\u641e\u5b9a\uff01 \u7b2c\u4e00\u6b65\uff1a\u6253\u5f00\u4e3b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":170,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-169","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":1,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/posts\/169\/revisions\/171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/media\/170"}],"wp:attachment":[{"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/media?parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/categories?post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anutool.com\/index.php\/wp-json\/wp\/v2\/tags?post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}