{"id":33224,"date":"2024-11-25T08:57:22","date_gmt":"2024-11-25T00:57:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/33224\/"},"modified":"2024-11-25T08:57:22","modified_gmt":"2024-11-25T00:57:22","slug":"wordpress%e6%80%8e%e4%b9%88%e5%81%9a%e5%88%b0%e8%be%93%e5%85%a5%e5%87%a0%e4%b8%aa%e6%95%b0%e8%b7%b3%e8%bd%ac%e5%88%b0%e7%bb%93%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/33224\/","title":{"rendered":"wordpress\u600e\u4e48\u505a\u5230\u8f93\u5165\u51e0\u4e2a\u6570,\u8df3\u8f6c\u5230\u7ed3\u679c"},"content":{"rendered":"<blockquote><p>\n  \u5728 wordpress \u4e2d\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u7ed3\u679c\u7684\u6b65\u9aa4\uff1a\u521b\u5efa\u81ea\u5b9a\u4e49\u5b57\u6bb5\u201c\u8df3\u8f6c\u6570\u5b57\u201d\uff0c\u9009\u62e9\u6570\u636e\u7c7b\u578b\u4e3a\u6570\u5b57\u3002\u521b\u5efa\u6a21\u677f\u6587\u4ef6 &#8220;jump-to-result.php&#8221;\uff0c\u5305\u542b\u8f93\u5165\u6570\u5b57\u7684\u8868\u5355\u548c\u8df3\u8f6c\u5230\u7ed3\u679c\u9875\u9762\u7684\u4ee3\u7801\u3002\u5728\u9700\u8981\u663e\u793a\u8868\u5355\u7684\u9875\u9762\u4e2d\u4f7f\u7528\u4ee3\u7801\u52a0\u8f7d\u6a21\u677f\u3002\u5728\u7ed3\u679c\u9875\u9762 &#8220;result-page.php&#8221; \u4e2d\u5904\u7406\u901a\u8fc7 get \u8bf7\u6c42\u4f20\u9012\u7684\u6570\u5b57\u5e76\u5c06\u5176\u663e\u793a\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/15\/2024041517124710922.jpg\" class=\"aligncenter\" title=\"wordpress\u600e\u4e48\u505a\u5230\u8f93\u5165\u51e0\u4e2a\u6570,\u8df3\u8f6c\u5230\u7ed3\u679c\u63d2\u56fe\" alt=\"wordpress\u600e\u4e48\u505a\u5230\u8f93\u5165\u51e0\u4e2a\u6570,\u8df3\u8f6c\u5230\u7ed3\u679c\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 WordPress \u4e2d\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u7ed3\u679c<\/strong><\/p>\n<p>\u5728 WordPress \u7f51\u7ad9\u4e0a\u5b9e\u73b0\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u7ed3\u679c\u529f\u80fd\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u505a\u5230\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u521b\u5efa\u81ea\u5b9a\u4e49\u5b57\u6bb5<\/strong><\/p>\n<p>\u8f6c\u5230 WordPress \u4eea\u8868\u76d8\u4e2d\u7684\u201c\u81ea\u5b9a\u4e49\u5b57\u6bb5\u201d\u83dc\u5355\uff08\u4f4d\u4e8e\u201c\u8bbe\u7f6e\u201d\u4e0b\uff09\u3002<br \/>\u4e3a\u60a8\u7684\u81ea\u5b9a\u4e49\u5b57\u6bb5\u521b\u5efa\u4e00\u4e2a\u540d\u79f0\uff0c\u4f8b\u5982\u201c\u8df3\u8f6c\u6570\u5b57\u201d\u3002<br \/>\u9009\u62e9\u6570\u636e\u7c7b\u578b\u4e3a\u201c\u6570\u5b57\u201d\u3002<\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u521b\u5efa\u6a21\u677f\u6587\u4ef6<\/strong><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6a21\u677f\u6587\u4ef6\uff0c\u4f8b\u5982\u201cjump-to-result.php\u201d\u3002<br \/>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>&lt;?php\nif ( isset( $_POST['jump-number'] ) ) {\n    $number = $_POST['jump-number'];\n    header( \"Location: result-page.php?number=\" . $number );\n}\n?&gt;\n\n&lt;form method=\"post\"&gt;\n    &lt;label for=\"jump-number\"&gt;\u8f93\u5165\u6570\u5b57\uff1a&lt;\/label&gt;\n    &lt;input type=\"number\" name=\"jump-number\" id=\"jump-number\"&gt;\n    &lt;button type=\"submit\"&gt;\u8df3\u8f6c&lt;\/button&gt;\n&lt;\/form&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06\u201cresult-page.php\u201d\u66ff\u6362\u4e3a\u60a8\u5e0c\u671b\u8df3\u8f6c\u5230\u7684\u7ed3\u679c\u9875\u9762\u7684\u6587\u4ef6\u540d\u3002<\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u5728\u9875\u9762\u4e2d\u4f7f\u7528\u6a21\u677f<\/strong><\/p>\n<p>\u5728\u60a8\u5e0c\u671b\u663e\u793a\u8868\u5355\u7684\u9875\u9762\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u52a0\u8f7d\u6a21\u677f\uff1a<\/p>\n<pre>&lt;?php get_template_part( 'jump-to-result' ); ?&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u5904\u7406\u7ed3\u679c\u9875\u9762<\/strong><\/p>\n<p>\u5728\u201cresult-page.php\u201d\u6587\u4ef6\u4e2d\uff0c\u83b7\u53d6\u901a\u8fc7 GET \u8bf7\u6c42\u4f20\u9012\u7684\u6570\u5b57\uff0c\u5e76\u5c06\u5176\u663e\u793a\u5728\u9875\u9762\u4e0a\uff1a<\/p>\n<pre>&lt;?php\nif ( isset( $_GET['number'] ) ) {\n    $number = $_GET['number'];\n    echo \"\u60a8\u8f93\u5165\u7684\u6570\u5b57\u662f\uff1a$number\";\n}\n?&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u7528\u6237\u5c06\u80fd\u591f\u5728\u60a8\u7684 WordPress \u7f51\u7ad9\u4e0a\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u663e\u793a\u7ed3\u679c\u7684\u9875\u9762\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u505a\u5230\u8f93\u5165\u51e0\u4e2a\u6570,\u8df3\u8f6c\u5230\u7ed3\u679c\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>\u5728 wordpress \u4e2d\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u7ed3\u679c\u7684\u6b65\u9aa4\uff1a\u521b\u5efa\u81ea\u5b9a\u4e49\u5b57\u6bb5\u201c\u8df3\u8f6c\u6570\u5b57\u201d\uff0c\u9009\u62e9\u6570\u636e\u7c7b\u578b\u4e3a\u6570\u5b57\u3002\u521b\u5efa\u6a21\u677f\u6587\u4ef6 &#8220;jump-to-result.php&#8221;\uff0c\u5305\u542b\u8f93\u5165\u6570\u5b57\u7684\u8868\u5355\u548c\u8df3\u8f6c\u5230\u7ed3\u679c\u9875\u9762\u7684\u4ee3\u7801\u3002\u5728\u9700\u8981\u663e\u793a\u8868\u5355\u7684\u9875\u9762\u4e2d\u4f7f\u7528\u4ee3\u7801\u52a0\u8f7d\u6a21\u677f\u3002\u5728\u7ed3\u679c\u9875\u9762 &#8220;result-page.php&#8221; \u4e2d\u5904\u7406\u901a\u8fc7 get \u8bf7\u6c42\u4f20\u9012\u7684\u6570\u5b57\u5e76\u5c06\u5176\u663e\u793a\u3002 \u5982\u4f55\u5728 WordPress \u4e2d\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u7ed3\u679c \u5728 WordPress \u7f51\u7ad9\u4e0a\u5b9e\u73b0\u8f93\u5165\u6570\u5b57\u5e76\u8df3\u8f6c\u5230\u7ed3\u679c\u529f\u80fd\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u8fc7\u7a0b\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u505a\u5230\uff1a \u6b65\u9aa4 1\uff1a\u521b\u5efa\u81ea\u5b9a\u4e49\u5b57\u6bb5 \u8f6c\u5230 WordPress \u4eea\u8868\u76d8\u4e2d\u7684\u201c\u81ea\u5b9a\u4e49\u5b57\u6bb5\u201d\u83dc\u5355\uff08\u4f4d\u4e8e\u201c\u8bbe\u7f6e\u201d\u4e0b\uff09\u3002\u4e3a\u60a8\u7684\u81ea\u5b9a\u4e49\u5b57\u6bb5\u521b\u5efa\u4e00\u4e2a\u540d\u79f0\uff0c\u4f8b\u5982\u201c\u8df3\u8f6c\u6570\u5b57\u201d\u3002\u9009\u62e9\u6570\u636e\u7c7b\u578b\u4e3a\u201c\u6570\u5b57\u201d\u3002 \u6b65\u9aa4 2\uff1a\u521b\u5efa\u6a21\u677f\u6587\u4ef6 \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6a21\u677f\u6587\u4ef6\uff0c\u4f8b\u5982\u201cjump-to-result.php\u201d\u3002\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a &lt;?php if ( isset( $_POST[&#8216;jump-number&#8217;] ) ) { $number = $_POST[&#8216;jump-number&#8217;]; header( &#8220;Location: result-page.php?number=&#8221; . $number ); } ?&gt; &lt;form method=&#8221;post&#8221;&gt; &lt;label for=&#8221;jump-number&#8221;&gt;\u8f93\u5165\u6570\u5b57\uff1a&lt;\/label&gt; &lt;input type=&#8221;number&#8221; name=&#8221;jump-number&#8221; id=&#8221;jump-number&#8221;&gt; &lt;button type=&#8221;submit&#8221;&gt;\u8df3\u8f6c&lt;\/button&gt; &lt;\/form&gt; \u767b\u5f55\u540e\u590d\u5236 \u5c06\u201cresult-page.php\u201d\u66ff\u6362\u4e3a\u60a8\u5e0c\u671b\u8df3\u8f6c\u5230\u7684\u7ed3\u679c\u9875\u9762\u7684\u6587\u4ef6\u540d\u3002 \u6b65\u9aa4 [&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-33224","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33224","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=33224"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/33224\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=33224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=33224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=33224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}