{"id":32733,"date":"2024-11-25T14:30:30","date_gmt":"2024-11-25T06:30:30","guid":{"rendered":"https:\/\/fwq.ai\/blog\/32733\/"},"modified":"2024-11-25T14:30:30","modified_gmt":"2024-11-25T06:30:30","slug":"%e5%a6%82%e4%bd%95%e5%bc%80%e5%8f%91%e4%b8%80%e4%b8%aa%e8%87%aa%e5%8a%a8%e7%94%9f%e6%88%90%e4%ba%ba%e5%91%98%e5%90%8d%e5%8d%95%e7%9a%84wordpress%e6%8f%92%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/32733\/","title":{"rendered":"\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/465\/014\/169387706785787.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6\u63d2\u56fe\" alt=\"\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6\u63d2\u56fe\" \/><\/p>\n<p>\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6<\/p>\n<p>WordPress\u4f5c\u4e3a\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u800c\u4e14\u7075\u6d3b\u7684\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u8bb8\u591a\u81ea\u5b9a\u4e49\u63d2\u4ef6\u7684\u5f00\u53d1\u673a\u4f1a\u3002\u5176\u4e2d\uff0c\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684\u63d2\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u7f51\u7ad9\u7ba1\u7406\u5458\u5feb\u901f\u800c\u9ad8\u6548\u5730\u7ba1\u7406\u548c\u5c55\u793a\u56e2\u961f\u6210\u5458\u6216\u5ba2\u6237\u5217\u8868\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6\uff0c\u5e76\u9644\u4e0a\u76f8\u5173\u4ee3\u7801\u793a\u4f8b\u3002<\/p>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684WordPress\u63d2\u4ef6\u3002\u5728WordPress\u5b89\u88c5\u76ee\u5f55\u7684wp-content\/plugins\/\u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939\uff0c\u547d\u540d\u4e3apersonnel-list-plugin\u3002\u5728\u8be5\u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3apersonnel-list-plugin.php\u7684\u4e3b\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>&lt;?php \/*\nPlugin Name: Personnel List Plugin\nPlugin URI: https:\/\/www.example.com\/plugins\/personnel-list-plugin\nDescription: A plugin to generate and display personnel list on WordPress site.\nVersion: 1.0\nAuthor: Your Name\nAuthor URI: https:\/\/www.example.com\/\nLicense: GPL2\n*\/\n\n\/\/ Plugin code will be placed here\n?&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u63d2\u4ef6\uff0c\u5305\u62ec\u540d\u79f0\u3001\u63cf\u8ff0\u3001\u7248\u672c\u7b49\u57fa\u672c\u4fe1\u606f\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u5728\u63d2\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3apersonnel_list\u7684shortcode\uff08\u77ed\u4ee3\u7801\uff09\uff0c\u7528\u4e8e\u5728\u9875\u9762\u6216\u6587\u7ae0\u4e2d\u63d2\u5165\u4eba\u5458\u540d\u5355\u3002\u5728personnel-list-plugin.php\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>function personnel_list_shortcode() {\n    \/\/ Generate and return personnel list HTML code\n    $html = \"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<ul>\n  &#8220;; \/\/ Replace the following with your code to fetch and display personnel data from database or any other source $html .= &#8221; <\/p>\n<li>Person 1<\/li>\n<p>&#8220;; $html .= &#8221; <\/p>\n<li>Person 2<\/li>\n<p>&#8220;; $html .= &#8221; <\/p>\n<li>Person 3<\/li>\n<p>&#8220;; $html .= &#8221;\n<\/ul>\n<p>&#8220;; return $html; } add_shortcode(&#8216;personnel_list&#8217;, &#8216;personnel_list_shortcode&#8217;); <\/p>\n<p>\u4e0a\u8ff0\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a\u540d\u4e3apersonnel_list\u7684shortcode\uff0c\u5e76\u901a\u8fc7personnel_list_shortcode\u51fd\u6570\u751f\u6210\u4eba\u5458\u540d\u5355\u7684HTML\u4ee3\u7801\u3002\u8fd9\u91cc\u7684\u793a\u4f8b\u4ee3\u7801\u53ea\u662f\u7b80\u5355\u5730\u8f93\u51fa\u4e86\u4e00\u4e2a\u65e0\u5e8f\u5217\u8868\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u66ff\u6362\u8fd9\u90e8\u5206\u4ee3\u7801\uff0c\u4f8b\u5982\u4ece\u6570\u636e\u5e93\u4e2d\u83b7\u53d6\u4eba\u5458\u6570\u636e\u5e76\u751f\u6210\u5bf9\u5e94\u7684HTML\u4ee3\u7801\u3002<\/p>\n<p>\u4fdd\u5b58\u5e76\u6fc0\u6d3b\u63d2\u4ef6\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u9875\u9762\u6216\u6587\u7ae0\u4e2d\u4f7f\u7528[personnel_list]\u77ed\u4ee3\u7801\u6765\u63d2\u5165\u4eba\u5458\u540d\u5355\u4e86\u3002<\/p>\n<p>\u5f53\u7136\uff0c\u4e0a\u8ff0\u4ee3\u7801\u53ea\u662f\u4e00\u4e2a\u7b80\u5355\u793a\u4f8b\uff0c\u5982\u679c\u4f60\u9700\u8981\u66f4\u590d\u6742\u7684\u529f\u80fd\u6216\u66f4\u4e30\u5bcc\u7684\u4eba\u5458\u540d\u5355\u6837\u5f0f\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u8fdb\u884c\u63d2\u4ef6\u5f00\u53d1\u3002\u4e0b\u9762\u662f\u51e0\u4e2a\u63d0\u5347\u63d2\u4ef6\u529f\u80fd\u7684\u5efa\u8bae\uff1a<\/p>\n<ol>\n<li>\u6dfb\u52a0\u540e\u53f0\u8bbe\u7f6e\u9875\u9762\uff1a\u901a\u8fc7\u6dfb\u52a0\u4e00\u4e2a\u540e\u53f0\u8bbe\u7f6e\u9875\u9762\uff0c\u4f60\u53ef\u4ee5\u8ba9\u7528\u6237\u81ea\u5b9a\u4e49\u4eba\u5458\u540d\u5355\u7684\u6837\u5f0f\u3001\u663e\u793a\u65b9\u5f0f\u3001\u6570\u636e\u6e90\u7b49\u3002<\/li>\n<li>\u8fde\u63a5\u6570\u636e\u5e93\uff1a\u5982\u679c\u4f60\u9700\u8981\u4ece\u6570\u636e\u5e93\u4e2d\u83b7\u53d6\u4eba\u5458\u6570\u636e\uff0c\u53ef\u4ee5\u4f7f\u7528WordPress\u63d0\u4f9b\u7684\u6570\u636e\u5e93API\uff0c\u4f8b\u5982$wpdb\u5bf9\u8c61\uff0c\u6765\u8fde\u63a5\u6570\u636e\u5e93\u5e76\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u3002<\/li>\n<li>\u589e\u52a0\u4eba\u5458\u4fe1\u606f\u7f16\u8f91\u529f\u80fd\uff1a\u4e3a\u63d2\u4ef6\u6dfb\u52a0\u4e00\u4e2a\u540e\u53f0\u7ba1\u7406\u754c\u9762\uff0c\u5141\u8bb8\u7528\u6237\u6dfb\u52a0\u3001\u7f16\u8f91\u548c\u5220\u9664\u4eba\u5458\u4fe1\u606f\u3002<\/li>\n<li>\u652f\u6301\u4eba\u5458\u5206\u7c7b\u548c\u7b5b\u9009\uff1a\u4e3a\u4eba\u5458\u540d\u5355\u6dfb\u52a0\u5206\u7c7b\u6807\u7b7e\u6216\u7b5b\u9009\u529f\u80fd\uff0c\u4fbf\u4e8e\u7528\u6237\u6309\u7167\u4e0d\u540c\u6807\u51c6\u67e5\u770b\u7279\u5b9a\u7c7b\u578b\u7684\u4eba\u5458\u3002<\/li>\n<\/ol>\n<p>\u5e0c\u671b\u4ee5\u4e0a\u793a\u4f8b\u4ee3\u7801\u548c\u5efa\u8bae\u80fd\u591f\u5e2e\u52a9\u4f60\u5f00\u53d1\u4e00\u4e2a\u5b9e\u7528\u800c\u4e14\u5f3a\u5927\u7684\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6\u3002\u795d\u4f60\u5f00\u53d1\u987a\u5229\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6 WordPress\u4f5c\u4e3a\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u800c\u4e14\u7075\u6d3b\u7684\u5185\u5bb9\u7ba1\u7406\u7cfb\u7edf\uff0c\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u8bb8\u591a\u81ea\u5b9a\u4e49\u63d2\u4ef6\u7684\u5f00\u53d1\u673a\u4f1a\u3002\u5176\u4e2d\uff0c\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684\u63d2\u4ef6\u53ef\u4ee5\u5e2e\u52a9\u7f51\u7ad9\u7ba1\u7406\u5458\u5feb\u901f\u800c\u9ad8\u6548\u5730\u7ba1\u7406\u548c\u5c55\u793a\u56e2\u961f\u6210\u5458\u6216\u5ba2\u6237\u5217\u8868\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5f00\u53d1\u4e00\u4e2a\u81ea\u52a8\u751f\u6210\u4eba\u5458\u540d\u5355\u7684WordPress\u63d2\u4ef6\uff0c\u5e76\u9644\u4e0a\u76f8\u5173\u4ee3\u7801\u793a\u4f8b\u3002 \u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684WordPress\u63d2\u4ef6\u3002\u5728WordPress\u5b89\u88c5\u76ee\u5f55\u7684wp-content\/plugins\/\u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939\uff0c\u547d\u540d\u4e3apersonnel-list-plugin\u3002\u5728\u8be5\u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3apersonnel-list-plugin.php\u7684\u4e3b\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a &lt;?php \/* Plugin Name: Personnel List Plugin Plugin URI: https:\/\/www.example.com\/plugins\/personnel-list-plugin Description: A plugin to generate and display personnel list on WordPress site. Version: 1.0 Author: Your Name Author URI: https:\/\/www.example.com\/ License: GPL2 *\/ \/\/ Plugin code will be placed here ?&gt; \u767b\u5f55\u540e\u590d\u5236 \u4e0a\u8ff0\u4ee3\u7801\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u63d2\u4ef6\uff0c\u5305\u62ec\u540d\u79f0\u3001\u63cf\u8ff0\u3001\u7248\u672c\u7b49\u57fa\u672c\u4fe1\u606f\u3002 \u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u5728\u63d2\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u540d\u4e3apersonnel_list\u7684shortcode\uff08\u77ed\u4ee3\u7801\uff09\uff0c\u7528\u4e8e\u5728\u9875\u9762\u6216\u6587\u7ae0\u4e2d\u63d2\u5165\u4eba\u5458\u540d\u5355\u3002\u5728personnel-list-plugin.php\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a function personnel_list_shortcode() { \/\/ Generate and return personnel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-32733","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/32733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=32733"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/32733\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=32733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=32733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=32733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}