{"id":28883,"date":"2024-11-25T08:30:59","date_gmt":"2024-11-25T00:30:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28883\/"},"modified":"2024-11-25T08:30:59","modified_gmt":"2024-11-25T00:30:59","slug":"wordpress%e6%80%8e%e4%b9%88%e5%bf%ab%e9%80%9f%e6%b7%bb%e5%8a%a0%e5%8f%8b%e6%83%85%e9%93%be%e6%8e%a5%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28883\/","title":{"rendered":"WordPress\u600e\u4e48\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5de709ef6a21c306.jpg\" class=\"aligncenter\" title=\"WordPress\u600e\u4e48\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\u63d2\u56fe\" alt=\"WordPress\u600e\u4e48\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u600e\u4e48\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\uff1f<\/strong><\/p>\n<p>\u672c\u6587\u5b9e\u4f8b\u8bb2\u8ff0\u4e86WordPress\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\u7684\u65b9\u6cd5\u3002\u5206\u4eab\u7ed9\u5927\u5bb6\u4f9b\u5927\u5bb6\u53c2\u8003\u3002\u5177\u4f53\u65b9\u6cd5\u5206\u6790\u5982\u4e0b\uff1a<\/p>\n<p>\u63a8\u8350\uff1a\u300a\u300b<\/p>\n<p>WordPress\u7cfb\u7edf\u9ed8\u8ba4\u4e0b\u662f\u6ca1\u6709\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\u7684,\u4e3a\u4e86\u7f51\u7ad9\u66f4\u597d\u7684\u4f18\u5316\u6211\u4eec\u9700\u5bf9\u5b83\u52a0\u4e2a\u53cb\u60c5\u8fde\u63a5\u529f\u80fd,\u4e0b\u9762\u6211\u628a\u6211\u5728wordpress\u4e2d\u589e\u52a0\u53cb\u60c5\u94fe\u63a5\u5177\u4f53\u65b9\u6cd5\u5206\u4eab\u7ed9\u5927\u5bb6.<\/p>\n<p>WordPress \u5728 3.5 \u5df1\u7ecf\u9690\u85cf\u4e86,\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u5b9e\u73b0\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5,\u5b9e\u4f8b\u4ee3\u7801\u5982\u4e0b:<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>&lt;?php \/*\nPlugin Name: WPJAM Blogroll\nDescription: \u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\nVersion: 0.1\nAuthor: Denis\n*\/\nadd_action(&#039;admin_init&#039;, &#039;wpjam_blogroll_settings_api_init&#039;);\nfunction wpjam_blogroll_settings_api_init() {\nadd_settings_field(&#039;wpjam_blogroll_setting&#039;, &#039;\u53cb\u60c5\u94fe\u63a5&#039;, &#039;wpjam_blogroll_setting_callback_function&#039;, &#039;reading&#039;);\nregister_setting(&#039;reading&#039;,&#039;wpjam_blogroll_setting&#039;);\n}\nfunction wpjam_blogroll_setting_callback_function() {\necho &#039;&lt;textarea name=\"wpjam_blogroll_setting\" rows=\"10\" cols=\"50\" id=\"wpjam_blogroll_setting\" class=\"large-text code\"&gt;'&nbsp;.&nbsp;get_option('wpjam_blogroll_setting')&nbsp;.&nbsp;'';\n}\nfunction&nbsp;wpjam_blogroll(){\n$wpjam_blogroll_setting&nbsp;=&nbsp;get_option('wpjam_blogroll_setting');\nif($wpjam_blogroll_setting){\n$wpjam_blogrolls&nbsp;=&nbsp;explode(\"n\",&nbsp;$wpjam_blogroll_setting);\nforeach&nbsp;($wpjam_blogrolls&nbsp;as&nbsp;$wpjam_blogroll)&nbsp;{\n$wpjam_blogroll&nbsp;=&nbsp;explode(\"|\",&nbsp;$wpjam_blogroll&nbsp;);\necho&nbsp;'&nbsp;|&nbsp;&lt;a&gt;'.trim($wpjam_blogroll[1]).'&lt;\/a&gt;';\n}\n}\n}\n?&amp;gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9996\u5148\u5c06\u4e0a\u9762\u7684\u4ee3\u7801\u590d\u5236\u5230\u5f53\u524d\u4e3b\u9898\u7684 functions.php \u6587\u4ef6\u4e2d,\u6216\u8005\u5355\u72ec\u4f5c\u4e3a\u4e00\u4e2a\u63d2\u4ef6\u6fc0\u6d3b,\u7136\u540e\u5c31\u53ef\u4ee5\u5728 WordPress \u540e\u53f0 &gt; \u8bbe\u7f6e &gt; \u9605\u8bfb \u754c\u9762,\u5c31\u6709\u4e00\u4e2a\u53cb\u60c5\u94fe\u63a5\u6dfb\u52a0\u7684\u8f93\u5165\u6846,\u6309\u7167 \u94fe\u63a5 |\u6807\u9898 \u7684\u65b9\u5f0f\u8f93\u5165\u6240\u6709\u7684\u53cb\u60c5\u94fe\u63a5.<\/p>\n<p>\u65b9\u6cd5\u4e8c:\u5c06\u4e0b\u9762\u7684\u4ee3\u7801\u6dfb\u52a0\u5230\u5f53\u524d\u4e3b\u9898\u7684 functions.php \u6587\u4ef6\u4e2d,\u6216\u8005\u53e6\u5b58\u4e3a\u5355\u72ec\u7684php\u6587\u4ef6,\u4e0a\u4f20\u5230\u63d2\u4ef6\u76ee\u5f55\u6fc0\u6d3b,\u4ee3\u7801\u5982\u4e0b:<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>&lt;?php add_action(&#039;admin_init&#039;, &#039;wpjam_blogroll_settings_api_init&#039;);\nfunction wpjam_blogroll_settings_api_init() {\nadd_settings_field(&#039;wpjam_blogroll_setting&#039;, &#039;\u53cb\u60c5\u94fe\u63a5&#039;, &#039;wpjam_blogroll_setting_callback_function&#039;, &#039;reading&#039;);\nregister_setting(&#039;reading&#039;,&#039;wpjam_blogroll_setting&#039;);\n}\nfunction wpjam_blogroll_setting_callback_function() {\necho &#039;&lt;textarea name=\"wpjam_blogroll_setting\" rows=\"10\" cols=\"50\" id=\"wpjam_blogroll_setting\" class=\"large-text code\"&gt;'&nbsp;.&nbsp;get_option('wpjam_blogroll_setting')&nbsp;.&nbsp;'';\n}\nfunction&nbsp;wpjam_blogroll(){\n$wpjam_blogroll_setting&nbsp;=&nbsp;get_option('wpjam_blogroll_setting');\nif($wpjam_blogroll_setting){\n$wpjam_blogrolls&nbsp;=&nbsp;explode(\"n\",&nbsp;$wpjam_blogroll_setting);\nforeach&nbsp;($wpjam_blogrolls&nbsp;as&nbsp;$wpjam_blogroll)&nbsp;{\n$wpjam_blogroll&nbsp;=&nbsp;explode(\"|\",&nbsp;$wpjam_blogroll&nbsp;);\necho&nbsp;'&nbsp;|&nbsp;&lt;a&gt;'.trim($wpjam_blogroll[1]).'&lt;\/a&gt;';\n}\n}\n}\n?&amp;gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u5728 WordPress \u540e\u53f0 &gt; \u8bbe\u7f6e &gt; \u9605\u8bfb \u754c\u9762,\u5c31\u6709\u4e00\u4e2a\u53cb\u60c5\u94fe\u63a5\u6dfb\u52a0\u7684\u8f93\u5165\u6846,\u6309\u7167 \u94fe\u63a5 |\u6807\u9898 \u7684\u65b9\u5f0f\u8f93\u5165\u6240\u6709\u7684\u53cb\u60c5\u94fe\u63a5.<\/p>\n<p>\u6700\u540e\u5728\u9700\u8981\u663e\u793a\u53cb\u60c5\u94fe\u63a5\u7684\u6a21\u677f\u6587\u4ef6\u7684\u9002\u5f53\u4f4d\u7f6e,\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u8fdb\u884c\u8c03\u7528\uff1a<\/p>\n<p>\u590d\u5236\u4ee3\u7801\u4ee3\u7801\u5982\u4e0b:<\/p>\n<\/p>\n<p>\u5e0c\u671b\u672c\u6587\u6240\u8ff0\u5bf9\u5927\u5bb6\u7684WordPress\u5efa\u7ad9\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fWordPress\u600e\u4e48\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\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>\u600e\u4e48\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\uff1f \u672c\u6587\u5b9e\u4f8b\u8bb2\u8ff0\u4e86WordPress\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\u7684\u65b9\u6cd5\u3002\u5206\u4eab\u7ed9\u5927\u5bb6\u4f9b\u5927\u5bb6\u53c2\u8003\u3002\u5177\u4f53\u65b9\u6cd5\u5206\u6790\u5982\u4e0b\uff1a \u63a8\u8350\uff1a\u300a\u300b WordPress\u7cfb\u7edf\u9ed8\u8ba4\u4e0b\u662f\u6ca1\u6709\u53cb\u60c5\u94fe\u63a5\u529f\u80fd\u7684,\u4e3a\u4e86\u7f51\u7ad9\u66f4\u597d\u7684\u4f18\u5316\u6211\u4eec\u9700\u5bf9\u5b83\u52a0\u4e2a\u53cb\u60c5\u8fde\u63a5\u529f\u80fd,\u4e0b\u9762\u6211\u628a\u6211\u5728wordpress\u4e2d\u589e\u52a0\u53cb\u60c5\u94fe\u63a5\u5177\u4f53\u65b9\u6cd5\u5206\u4eab\u7ed9\u5927\u5bb6. WordPress \u5728 3.5 \u5df1\u7ecf\u9690\u85cf\u4e86,\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4ee3\u7801\u5b9e\u73b0\u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5,\u5b9e\u4f8b\u4ee3\u7801\u5982\u4e0b: \u4ee3\u7801\u5982\u4e0b: &lt;?php \/* Plugin Name: WPJAM Blogroll Description: \u5feb\u901f\u6dfb\u52a0\u53cb\u60c5\u94fe\u63a5 Version: 0.1 Author: Denis *\/ add_action(&#039;admin_init&#039;, &#039;wpjam_blogroll_settings_api_init&#039;); function wpjam_blogroll_settings_api_init() { add_settings_field(&#039;wpjam_blogroll_setting&#039;, &#039;\u53cb\u60c5\u94fe\u63a5&#039;, &#039;wpjam_blogroll_setting_callback_function&#039;, &#039;reading&#039;); register_setting(&#039;reading&#039;,&#039;wpjam_blogroll_setting&#039;); } function wpjam_blogroll_setting_callback_function() { echo &#039;&lt;textarea name=&#8221;wpjam_blogroll_setting&#8221; rows=&#8221;10&#8243; cols=&#8221;50&#8243; id=&#8221;wpjam_blogroll_setting&#8221; class=&#8221;large-text code&#8221;&gt;&#8217;&nbsp;.&nbsp;get_option(&#8216;wpjam_blogroll_setting&#8217;)&nbsp;.&nbsp;&#8221;; } function&nbsp;wpjam_blogroll(){ $wpjam_blogroll_setting&nbsp;=&nbsp;get_option(&#8216;wpjam_blogroll_setting&#8217;); if($wpjam_blogroll_setting){ $wpjam_blogrolls&nbsp;=&nbsp;explode(&#8220;n&#8221;,&nbsp;$wpjam_blogroll_setting); foreach&nbsp;($wpjam_blogrolls&nbsp;as&nbsp;$wpjam_blogroll)&nbsp;{ $wpjam_blogroll&nbsp;=&nbsp;explode(&#8220;|&#8221;,&nbsp;$wpjam_blogroll&nbsp;); echo&nbsp;&#8216;&nbsp;|&nbsp;&lt;a&gt;&#8217;.trim($wpjam_blogroll[1]).'&lt;\/a&gt;&#8217;; } } } [&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-28883","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28883","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=28883"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28883\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}