{"id":30186,"date":"2024-11-25T13:28:02","date_gmt":"2024-11-25T05:28:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30186\/"},"modified":"2024-11-25T13:28:02","modified_gmt":"2024-11-25T05:28:02","slug":"dedefield-nameposition%e6%80%8e%e4%b9%88%e5%8e%bb%e9%99%a4%e6%9c%80%e5%90%8e%e4%b8%80%e4%b8%aa%e5%a4%a7%e4%ba%8e%e7%ac%a6%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30186\/","title":{"rendered":"dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5deefeee8a6f5833.jpg\" class=\"aligncenter\" title=\"dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7\u63d2\u56fe\" alt=\"dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7?<\/strong><\/p>\n<p>dede\u63d0\u4f9b\u4e86\u9762\u5305\u5c51\u7684\u529f\u80fd\u3002\u4f46\u662f\u6700\u540e\u9762\u603b\u4f1a\u5e26\u4e00\u4e2a&#8217;&gt;&#8217;\u7b26\u53f7\u3002\u751a\u662f\u70e6\u4eba\uff0c\u4e0b\u9762\u6709\u4e2a\u4e0d\u9519\u7684\u65b9\u6cd5\u53ef\u4ee5\u5e72\u6389\u5b83<\/p>\n<p>\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u4e8b\u60c5\uff1a&nbsp;<\/p>\n<p>dede\u63d0\u4f9b\u4e86\u9762\u5305\u5c51\u7684\u529f\u80fd\u3002\u4f46\u662f\u6700\u540e\u9762\u603b\u4f1a\u5e26\u4e00\u4e2a&#8217;&gt;&#8217;\u7b26\u53f7\u3002\u751a\u662f\u70e6\u4eba\u3002\u76ee\u6807\u5e72\u6389\u5b83\u3002&nbsp;<\/p>\n<p>\u7b2c\u4e00\u79cd\u89e3\u51b3\u65b9\u6cd5\uff1a 1. \u5728\u7cfb\u7edf\u53c2\u6570\u91cc\u9762\u4fee\u6539\u8fd9\u4e2a\u7b26\u53f7\u3002&nbsp;<\/p>\n<p>\u7b2c\u4e8c\u79cd\u89e3\u51b3\u65b9\u6cd5\uff1a 2. \u4f7f\u7528\u622a\u5b50\u7b26\uff0crunphp\u64cd\u4f5c\uff08\u7f51\u4e0a\u767e\u5ea6\u5f88\u591a\uff0c\u9057\u61be\u662f\u6211\u6ca1\u6709\u8bd5\u9a8c\u6210\u529f\uff09\u3002&nbsp;<\/p>\n<p>\u7b2c\u4e09\u79cd\u89e3\u51b3\u65b9\u6cd5\uff1a 3. \u4fee\u6539\u5e95\u5c42\u4ee3\u7801\u3002\uff08\u6211\u91c7\u7528\u7684\u8fd9\u79cd\uff0c\u8bd5\u9a8c\u4e86\uff0c\u53ef\u4ee5\uff09\u3002&nbsp;<\/p>\n<p>\u89e3\u51b3\uff1a&nbsp;<\/p>\n<p>\u627e\u5230 include\/typelink.class.php \u6587\u4ef6\u3002&nbsp;<\/p>\n<p>\u627e\u5230\u4e0b\u9762\u7684\u65b9\u6cd5\u3002&nbsp;<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b:<\/p>\n<pre>\/\/\u83b7\u5f97\u67d0\u7c7b\u76ee\u7684\u94fe\u63a5\u5217\u8868&nbsp;\u5982\uff1a\u7c7b\u76ee\u4e00&amp;gt;&amp;gt;\u7c7b\u76ee\u4e8c&amp;gt;&amp;gt;&nbsp;\u8fd9\u6837\u7684\u5f62\u5f0f&nbsp;\n\/\/islink&nbsp;\u8868\u793a\u8fd4\u56de\u7684\u5217\u8868\u662f\u5426\u5e26\u8fde\u63a5&nbsp;\nfunction&nbsp;GetPositionLink($islink=true)&nbsp;\n{&nbsp;\n$indexpage&nbsp;=&nbsp;\"&lt;a&gt;indexUrl.\"'&amp;gt;\".$this-&amp;gt;indexName.\"&lt;\/a&gt;\";&nbsp;\nif($this-&amp;gt;valuePosition!=\"\"&nbsp;&amp;amp;&amp;amp;&nbsp;$islink)&nbsp;\n{&nbsp;\nreturn&nbsp;$this-&amp;gt;valuePosition;&nbsp;\n}&nbsp;\nelse&nbsp;if($this-&amp;gt;valuePositionName!=\"\"&nbsp;&amp;amp;&amp;amp;&nbsp;!$islink)&nbsp;\n{&nbsp;\nreturn&nbsp;$this-&amp;gt;valuePositionName;&nbsp;\n}&nbsp;\nelse&nbsp;if($this-&amp;gt;TypeID==0)&nbsp;\n{&nbsp;\nif($islink)&nbsp;\n{&nbsp;\nreturn&nbsp;$indexpage;&nbsp;\n}&nbsp;\nelse&nbsp;\n{&nbsp;\nreturn&nbsp;\"\u6ca1\u6307\u5b9a\u5206\u7c7b\uff01\";&nbsp;\n}&nbsp;\n}&nbsp;\nelse&nbsp;\n{&nbsp;\nif($islink)&nbsp;\n{&nbsp;\n$this-&amp;gt;valuePosition&nbsp;=&nbsp;$this-&amp;gt;GetOneTypeLink($this-&amp;gt;TypeInfos);&nbsp;\nif($this-&amp;gt;TypeInfos['reid']!=0)&nbsp;\n{&nbsp;\n\/\/\u8c03\u7528\u9012\u5f52\u903b\u8f91&nbsp;\n$this-&amp;gt;LogicGetPosition($this-&amp;gt;TypeInfos['reid'],true);&nbsp;\n}&nbsp;\n$this-&amp;gt;valuePosition&nbsp;=&nbsp;$indexpage.$this-&amp;gt;SplitSymbol.$this-&amp;gt;valuePosition;&nbsp;\nreturn&nbsp;$this-&amp;gt;valuePosition.$this-&amp;gt;SplitSymbol;&nbsp;\/\/\u9700\u8981\u4fee\u6539\u8fd9\u91cc.....&nbsp;\n}&nbsp;\nelse&nbsp;\n{&nbsp;\n$this-&amp;gt;valuePositionName&nbsp;=&nbsp;$this-&amp;gt;TypeInfos['typename'];&nbsp;\nif($this-&amp;gt;TypeInfos['reid']!=0)&nbsp;\n{&nbsp;\n\/\/\u8c03\u7528\u9012\u5f52\u903b\u8f91&nbsp;\n$this-&amp;gt;LogicGetPosition($this-&amp;gt;TypeInfos['reid'],false);&nbsp;\n}&nbsp;\nreturn&nbsp;$this-&amp;gt;valuePositionName;&nbsp;\n}&nbsp;\n}&nbsp;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5c06\u4e0a\u9762\u7684\u9700\u8981\u4fee\u6539\u7684\u884c\uff0c\u6539\u6210\u8fd9\u6837\u5373\u53ef\uff1a return $this-&gt;valuePosition;&nbsp;<\/p>\n<p>5. \u6700\u7ec8\u6a21\u677f\u8c03\u7528\u7684{dede:field name=&#8217;position&#8217;\/}\u3002 \u6700\u7ec8\u6548\u679c\u56fe\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/800\/277\/935\/1575943800927302.png\" class=\"aligncenter\" title=\"dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7\u63d2\u56fe1\" alt=\"dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7\u63d2\u56fe1\" \/><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fdede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7\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>dede:field name=position\u600e\u4e48\u53bb\u9664\u6700\u540e\u4e00\u4e2a\u5927\u4e8e\u7b26\u53f7? dede\u63d0\u4f9b\u4e86\u9762\u5305\u5c51\u7684\u529f\u80fd\u3002\u4f46\u662f\u6700\u540e\u9762\u603b\u4f1a\u5e26\u4e00\u4e2a&#8217;&gt;&#8217;\u7b26\u53f7\u3002\u751a\u662f\u70e6\u4eba\uff0c\u4e0b\u9762\u6709\u4e2a\u4e0d\u9519\u7684\u65b9\u6cd5\u53ef\u4ee5\u5e72\u6389\u5b83 \u63a8\u8350\u5b66\u4e60\uff1a \u4e8b\u60c5\uff1a&nbsp; dede\u63d0\u4f9b\u4e86\u9762\u5305\u5c51\u7684\u529f\u80fd\u3002\u4f46\u662f\u6700\u540e\u9762\u603b\u4f1a\u5e26\u4e00\u4e2a&#8217;&gt;&#8217;\u7b26\u53f7\u3002\u751a\u662f\u70e6\u4eba\u3002\u76ee\u6807\u5e72\u6389\u5b83\u3002&nbsp; \u7b2c\u4e00\u79cd\u89e3\u51b3\u65b9\u6cd5\uff1a 1. \u5728\u7cfb\u7edf\u53c2\u6570\u91cc\u9762\u4fee\u6539\u8fd9\u4e2a\u7b26\u53f7\u3002&nbsp; \u7b2c\u4e8c\u79cd\u89e3\u51b3\u65b9\u6cd5\uff1a 2. \u4f7f\u7528\u622a\u5b50\u7b26\uff0crunphp\u64cd\u4f5c\uff08\u7f51\u4e0a\u767e\u5ea6\u5f88\u591a\uff0c\u9057\u61be\u662f\u6211\u6ca1\u6709\u8bd5\u9a8c\u6210\u529f\uff09\u3002&nbsp; \u7b2c\u4e09\u79cd\u89e3\u51b3\u65b9\u6cd5\uff1a 3. \u4fee\u6539\u5e95\u5c42\u4ee3\u7801\u3002\uff08\u6211\u91c7\u7528\u7684\u8fd9\u79cd\uff0c\u8bd5\u9a8c\u4e86\uff0c\u53ef\u4ee5\uff09\u3002&nbsp; \u89e3\u51b3\uff1a&nbsp; \u627e\u5230 include\/typelink.class.php \u6587\u4ef6\u3002&nbsp; \u627e\u5230\u4e0b\u9762\u7684\u65b9\u6cd5\u3002&nbsp; \u4ee3\u7801\u5982\u4e0b: \/\/\u83b7\u5f97\u67d0\u7c7b\u76ee\u7684\u94fe\u63a5\u5217\u8868&nbsp;\u5982\uff1a\u7c7b\u76ee\u4e00&amp;gt;&amp;gt;\u7c7b\u76ee\u4e8c&amp;gt;&amp;gt;&nbsp;\u8fd9\u6837\u7684\u5f62\u5f0f&nbsp; \/\/islink&nbsp;\u8868\u793a\u8fd4\u56de\u7684\u5217\u8868\u662f\u5426\u5e26\u8fde\u63a5&nbsp; function&nbsp;GetPositionLink($islink=true)&nbsp; {&nbsp; $indexpage&nbsp;=&nbsp;&#8220;&lt;a&gt;indexUrl.&#8221;&#8216;&amp;gt;&#8221;.$this-&amp;gt;indexName.&#8221;&lt;\/a&gt;&#8221;;&nbsp; if($this-&amp;gt;valuePosition!=&#8221;&#8221;&nbsp;&amp;amp;&amp;amp;&nbsp;$islink)&nbsp; {&nbsp; return&nbsp;$this-&amp;gt;valuePosition;&nbsp; }&nbsp; else&nbsp;if($this-&amp;gt;valuePositionName!=&#8221;&#8221;&nbsp;&amp;amp;&amp;amp;&nbsp;!$islink)&nbsp; {&nbsp; return&nbsp;$this-&amp;gt;valuePositionName;&nbsp; }&nbsp; else&nbsp;if($this-&amp;gt;TypeID==0)&nbsp; {&nbsp; if($islink)&nbsp; {&nbsp; return&nbsp;$indexpage;&nbsp; }&nbsp; else&nbsp; {&nbsp; return&nbsp;&#8220;\u6ca1\u6307\u5b9a\u5206\u7c7b\uff01&#8221;;&nbsp; }&nbsp; }&nbsp; else&nbsp; {&nbsp; if($islink)&nbsp; {&nbsp; $this-&amp;gt;valuePosition&nbsp;=&nbsp;$this-&amp;gt;GetOneTypeLink($this-&amp;gt;TypeInfos);&nbsp; if($this-&amp;gt;TypeInfos[&#8216;reid&#8217;]!=0)&nbsp; {&nbsp; \/\/\u8c03\u7528\u9012\u5f52\u903b\u8f91&nbsp; $this-&amp;gt;LogicGetPosition($this-&amp;gt;TypeInfos[&#8216;reid&#8217;],true);&nbsp; }&nbsp; [&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-30186","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30186","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=30186"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30186\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}