{"id":31012,"date":"2024-11-25T12:40:50","date_gmt":"2024-11-25T04:40:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31012\/"},"modified":"2024-11-25T12:40:50","modified_gmt":"2024-11-25T04:40:50","slug":"%e7%bb%87%e6%a2%a6dede%e5%a6%82%e4%bd%95%e8%ae%a9channelartlist%e6%a0%87%e7%ad%be%e6%94%af%e6%8c%81currentstyle%e5%b1%9e%e6%80%a7","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31012\/","title":{"rendered":"\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027"},"content":{"rendered":"<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e1684b5bc928151.jpg\" class=\"aligncenter\" title=\"\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027\u63d2\u56fe\" alt=\"\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027\u63d2\u56fe\" \/><\/p>\n<p><strong>\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027\uff1f<\/strong><\/p>\n<p>\u7ec7\u68a6dede\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027<\/p>\n<p>\u63a8\u8350\u5b66\u4e60\uff1a<\/p>\n<p>\u6253\u5f00include aglibchannelartlist.lib.php<\/p>\n<p>\u627e\u5230<\/p>\n<pre>$pv-&amp;gt;Fields['typeurl']&nbsp;=&nbsp;GetOneTypeUrlA($typeids[$i]);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u6b64\u884c\u4ee3\u7801\u4e0b\u65b9\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>if($typeids[$i]['id']&nbsp;==&nbsp;$refObj-&amp;gt;TypeLink-&amp;gt;TypeInfos['id']&nbsp;||&nbsp;$typeids[$i]['id']&nbsp;==&nbsp;$refObj-&amp;gt;TypeLink-&amp;gt;TypeInfos['topid']&nbsp;){\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$pv-&amp;gt;Fields['currentstyle']&nbsp;=&nbsp;$currentstyle&nbsp;?&nbsp;$currentstyle&nbsp;:&nbsp;'current';\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else{\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$pv-&amp;gt;Fields['currentstyle']&nbsp;=&nbsp;'';\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8c03\u7528\u65b9\u6cd5\uff1a<\/p>\n<pre>{dede:channelartlist&nbsp;typeid='2'&nbsp;currentstyle='current'}\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<li><\/li>\n<p> {\/dede:channelartlist} <\/p>\n<p>\u5982\u679c\u662f\u5f53\u524d\u680f\u76ee\u5219 li\u7684class\u5c5e\u6027\u663e\u793acurrent\uff0c\u5426\u5219\u663e\u793aclass=&#8221; \uff0c\u4e5f\u53ef\u4ee5\u4fee\u6539currentstyle=&#8217;\u8fd9\u91cc\u6539\u4e3a\u4f60\u9700\u8981\u7684\u7c7b\u540d&#8217;\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027\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>\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027\uff1f \u7ec7\u68a6dede\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027 \u63a8\u8350\u5b66\u4e60\uff1a \u6253\u5f00include aglibchannelartlist.lib.php \u627e\u5230 $pv-&amp;gt;Fields[&#8216;typeurl&#8217;]&nbsp;=&nbsp;GetOneTypeUrlA($typeids[$i]); \u767b\u5f55\u540e\u590d\u5236 \u5728\u6b64\u884c\u4ee3\u7801\u4e0b\u65b9\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a if($typeids[$i][&#8216;id&#8217;]&nbsp;==&nbsp;$refObj-&amp;gt;TypeLink-&amp;gt;TypeInfos[&#8216;id&#8217;]&nbsp;||&nbsp;$typeids[$i][&#8216;id&#8217;]&nbsp;==&nbsp;$refObj-&amp;gt;TypeLink-&amp;gt;TypeInfos[&#8216;topid&#8217;]&nbsp;){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$pv-&amp;gt;Fields[&#8216;currentstyle&#8217;]&nbsp;=&nbsp;$currentstyle&nbsp;?&nbsp;$currentstyle&nbsp;:&nbsp;&#8216;current&#8217;; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$pv-&amp;gt;Fields[&#8216;currentstyle&#8217;]&nbsp;=&nbsp;&#8221;; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} \u767b\u5f55\u540e\u590d\u5236 \u8c03\u7528\u65b9\u6cd5\uff1a {dede:channelartlist&nbsp;typeid=&#8217;2&#8242;&nbsp;currentstyle=&#8217;current&#8217;} \u767b\u5f55\u540e\u590d\u5236 {\/dede:channelartlist} \u5982\u679c\u662f\u5f53\u524d\u680f\u76ee\u5219 li\u7684class\u5c5e\u6027\u663e\u793acurrent\uff0c\u5426\u5219\u663e\u793aclass=&#8221; \uff0c\u4e5f\u53ef\u4ee5\u4fee\u6539currentstyle=&#8217;\u8fd9\u91cc\u6539\u4e3a\u4f60\u9700\u8981\u7684\u7c7b\u540d&#8217;\u3002 \u4ee5\u4e0a\u5c31\u662f\u7ec7\u68a6dede\u5982\u4f55\u8ba9channelartlist\u6807\u7b7e\u652f\u6301currentstyle\u5c5e\u6027\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-31012","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31012","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=31012"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31012\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}