{"id":5731,"date":"2025-02-07T18:48:43","date_gmt":"2025-02-07T10:48:43","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=5731"},"modified":"2025-02-07T18:49:34","modified_gmt":"2025-02-07T10:49:34","slug":"wordpress%e5%a6%82%e4%bd%95%e7%bb%99%e5%86%85%e5%ae%b9%e9%a1%b5%e6%b7%bb%e5%8a%a0%e4%bf%ae%e6%94%b9%e6%97%a5%e6%9c%9f%ef%bc%8c%e8%ae%a9%e6%96%87%e7%ab%a0%e8%87%aa%e5%8a%a8%e8%b0%83%e7%94%a8%e5%88%b0","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/5731.html","title":{"rendered":"WordPress\u5982\u4f55\u7ed9\u5185\u5bb9\u9875\u6dfb\u52a0\u4fee\u6539\u65e5\u671f\uff0c\u8ba9\u6587\u7ae0\u81ea\u52a8\u8c03\u7528\u5230\u6700\u540e\u4e00\u6b21\u4fee\u6539\u7684\u65f6\u95f4"},"content":{"rendered":"

WordPress\u5982\u4f55\u7ed9\u5185\u5bb9\u9875\u6dfb\u52a0\u4fee\u6539\u65e5\u671f\uff0c\u8ba9\u6587\u7ae0\u81ea\u52a8\u8c03\u7528\u5230\u6700\u540e\u4e00\u6b21\u4fee\u6539\u7684\u65f6\u95f4\uff0c\u8ba9\u8bbf\u95ee\u8005\u77e5\u9053\u4f60\u7684\u6587\u7ae0\u662f\u6700\u8fd1\u66f4\u65b0\u8fc7\u7684\u3002\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n

\"\"<\/a><\/p>\n

\u5b9e\u73b0\u65b9\u6cd5\uff1a\u6253\u5f00\u4e3b\u9898\u76ee\u5f55\u4e0b\u7684functions.php\u6587\u4ef6\uff0c\u5728\u6700\u540e\u6dfb\u52a0\u4e0b\u9762\u4ee3\u7801\uff1a<\/p>\n

\/\/\u6587\u7ae0\u6700\u540e\u66f4\u65b0\u65f6\u95f4\r\nfunction show_last_updated( $content ) {\r\n$u_time = get_the_time('U');\r\n$u_modified_time = get_the_modified_time('U');\r\nif ($u_modified_time >= $u_time + 86400) {\r\n$updated_date = get_the_modified_time('Y-m-j');\r\n$updated_time = get_the_modified_time('h:s');\r\n$custom_content .= '<p class=\"last-updated-date\">\u672c\u6587\u4e8e '. $updated_date . '  '. $updated_time .'\u66f4\u65b0\uff0c\u90e8\u5206\u5185\u5bb9\u5177\u6709\u65f6\u6548\u6027\uff0c\u5982\u6709\u5931\u6548\uff0c\u8bf7\u7559\u8a00\u3002<\/p>';\r\n}\r\n$custom_content .= $content;\r\nreturn $custom_content;\r\n}\r\nadd_filter( 'the_content', 'show_last_updated' )\r\n<\/code><\/pre>\n

\u5982\u56fe\u6240\u793a\uff1a<\/p>\n

\"\"<\/a><\/p>\n

\u7136\u540e\u5728\u4f60\u9875\u9762\u6837\u5f0f\u6587\u4ef6\u91cc\u52a0\u5165\u4e0b\u9762\u6837\u5f0f\uff1a<\/p>\n

.last-updated-date {\r\n    background-color: #fffbe5;\r\n    border: 1px solid #f5e295;\r\n    color: #de9e0e;\r\n    border-radius: 6px;\r\n    font-size: 14px;\r\n    margin-bottom: 20px;\r\n    padding: 10px 20px\r\n}\r\n\r\n.last-updated-date a {\r\n    color: #b98000\r\n}\r\n\r\n.last-updated-date a:hover {\r\n    color: #926500\r\n}\r\n<\/code><\/pre>\n

\u4fdd\u5b58\uff0c\u5237\u65b0\uff0c\u7ed3\u675f\u3002<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

WordPress\u5982\u4f55\u7ed9\u5185\u5bb9\u9875\u6dfb\u52a0\u4fee\u6539\u65e5\u671f\uff0c\u8ba9\u6587\u7ae0\u81ea\u52a8\u8c03\u7528\u5230\u6700\u540e\u4e00\u6b21\u4fee\u6539\u7684\u65f6\u95f4\uff0c\u8ba9\u8bbf\u95ee\u8005\u77e5\u9053\u4f60\u7684\u6587\u7ae0\u662f\u6700\u8fd1\u66f4\u65b0 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[5,1771,231],"class_list":["post-5731","post","type-post","status-publish","format-standard","hentry","category-web","tag-wordpress","tag-1771","tag-231"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=5731"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/5731\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=5731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=5731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=5731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}