{"id":60925,"date":"2025-04-26T08:42:06","date_gmt":"2025-04-26T00:42:06","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60925\/"},"modified":"2025-04-26T08:42:06","modified_gmt":"2025-04-26T00:42:06","slug":"%e5%ae%9e%e7%8e%b0zencart%e9%a6%96%e9%a1%b5%e9%9a%8f%e6%9c%ba%e4%ba%a7%e5%93%81%e6%a8%aa%e5%90%91%e6%bb%9a%e5%8a%a8%e6%95%88%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60925\/","title":{"rendered":"\u5b9e\u73b0ZenCart\u9996\u9875\u968f\u673a\u4ea7\u54c1\u6a2a\u5411\u6eda\u52a8\u6548\u679c"},"content":{"rendered":"<p> 1.\u5c06\u6587\u4ef6\u5939YOUR_TEMPLATE\u6539\u4e3a\u4f60\u6a21\u677f\u7684\u540d\u79f0<\/p>\n<p> 2.\u5c06includestemplatesYOUR_TEMPLATEtemplatestpl_random_default.php\u4e2d\u6587\u4ef6\u672b\u5c3e<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> &lt;script type=&#8221;text\/javascript&#8221;src=&#8221;includes\/templates\/YOUR_TEMPLATE\/jscript\/random.js&#8221;&gt;&lt;\/script&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4e2dYOUR_TEMPLATE\u6539\u4e3a\u4f60\u6a21\u677f\u7684\u540d\u79f0<\/p>\n<p> 3.\u4e0a\u4f20\u6587\u4ef6\u5373\u53ef<\/p>\n<p> \u4f7f\u7528\u65b9\u6cd5<\/p>\n<p> \u5728\u9700\u8981\u8c03\u7528\u7684\u5730\u65b9\u589e\u52a0<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> &lt;?php<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 2<\/td>\n<td> &nbsp;&nbsp;require($template-&gt;get_template_dir(&#8216;\/tpl_random_default.php&#8217;,DIR_WS_TEMPLATE,$current_page_base,&#8217;templates&#8217;).&#8217;\/tpl_random_default.php&#8217;); ?&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u5c0f\u6280\u5de7<\/p>\n<p> 1.\u4fee\u6539\u968f\u673a\u4ea7\u54c1\u4e2a\u6570<\/p>\n<p> \u4fee\u6539includestemplatesYOUR_TEMPLATEtemplatestpl_random_default.php<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> $num=10;\/\/\u968f\u673a\u4ea7\u54c1\u6570\u91cf<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> 2.\u5220\u9664\u4ea7\u54c1\u540d\u79f0\u6216\u4ef7\u683c\uff0c\u5728includestemplatesYOUR_TEMPLATEtemplatestpl_random_default.php\u5c06\u6ce8\u91ca\u540d\u79f0\u548c\u4ef7\u683c\u7684\u4e0b\u7684\u4ee3\u7801\u6ce8\u91ca<\/p>\n<p> 3.\u66f4\u6539\u81ea\u52a8\u79fb\u52a8\u901f\u5ea6\uff0c\u5728includestemplatesYOUR_TEMPLATEjscriptrandom.js<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> AutoPlayObj = setInterval(&#8216;ISL_GoDown();ISL_StopDown();&#8217;,3000);&nbsp;\/\/\u95f4\u9694\u65f6\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u6709\u670b\u53cb\u8bf4js\u6548\u679c\u4e0d\u6eda\u52a8\u7b49\u539f\u56e0\uff0c\u4f46\u662f\u6211\u81ea\u5df1\u5728\u9ed8\u8ba4\u6a21\u677f IE Firefox google chrome\u6d4b\u8bd5\u65f6\u90fd\u662f\u6b63\u5e38\u7684\uff0c\u4eca\u5929\u770b\u5230\u4e00\u6b3ejq\u7684\u56fe\u7247\u6eda\u52a8\u6548\u679c\u4e0d\u9519\uff0c\u7d22\u6027\u5c31\u5c06\u6362\u6765\u7684js\u6362\u6389\uff0c\u76f4\u63a5\u5957\u5230\u8fd9\u4e2a\u63d2\u4ef6\u91cc\u3002<\/p>\n<p> \u5b89\u88c5\u65b9\u6cd5<\/p>\n<p> 1.\u5c06\u6587\u4ef6\u5939YOUR_TEMPLATE\u6539\u4e3a\u4f60\u6a21\u677f\u7684\u540d\u79f0<\/p>\n<p> 2.\u5c06includestemplatesYOUR_TEMPLATEcommonhtml_header.php\u4e2d<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> &lt;?php&nbsp;if&nbsp;(isset($canonicalLink) &amp;&amp;&nbsp;$canonicalLink&nbsp;!=&nbsp;&#8221;) { ?&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 2<\/td>\n<td> &lt;link rel=&#8221;canonical&#8221;&nbsp;href=&#8221;&lt;?php echo $canonicalLink; ?&gt;&#8221;&nbsp;\/&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 3<\/td>\n<td> &lt;?php } ?&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u4e0b\u9762\u5f15\u5165google\u7684jq\u5e93<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> &lt;script src=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7.1\/jquery.min.js&#8221;type=&#8221;text\/javascript&#8221;&gt;&lt;\/script&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u5982\u679c\u6a21\u677f\u4e2d\u5df2\u7ecf\u5f15\u5165jq\u5e93\uff0c\u5219\u53ef\u4ee5\u7701\u7565<\/p>\n<p> 3.\u4e0a\u4f20\u6587\u4ef6\u5373\u53ef<\/p>\n<p> \u6548\u679c\u63a7\u5236<\/p>\n<p> \u5728includestemplatesYOUR_TEMPLATEjscriptjscript_random.js\u672b\u5c3e<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> $(document).ready(function(){<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 2<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#8220;#slideUl&#8221;).slide({<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 3<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;li_size:1,&nbsp;\/\/\u6bcf\u6b21\u6eda\u52a8li\u4e2a\u6570,\u9ed8\u8ba4\u4e00\u5c4f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 4<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;speed:1000,&nbsp;\/\/\u901f\u5ea6\uff1a\u6570\u503c\u8d8a\u5927\uff0c\u901f\u5ea6\u8d8a\u6162\uff08\u6beb\u79d2\uff09\u9ed8\u8ba4500<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 5<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timer:4000,&nbsp;\/\/\u4e0d\u9700\u8981\u81ea\u52a8\u6eda\u52a8\u5220\u6389\u8be5\u53c2\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 6<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;li_w:143,&nbsp;\/\/\u6bcf\u4e2ali\u7684\u5bbd\u5ea6\uff08\u5305\u62ecborder,margin,padding,\u90fd\u8981\u7b97\u8fdb\u53bb\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 7<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left:&#8221;sildeLeft&#8221;,<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 8<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;right:&#8221;sildeRight&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 9<\/td>\n<td> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 10<\/td>\n<td> });<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> \u8c03\u7528<\/p>\n<p> \u5728\u5728\u9700\u8981\u8c03\u7528\u7684\u5730\u65b9\u589e\u52a0\uff0c\u5982\u5728includestemplatesYOUR_TEMPLATEcommontpl_header.php\u4e2d\u589e\u52a0<\/p>\n<table>\n<tbody>\n<tr>\n<td> 1<\/td>\n<td> &lt;?php<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 2<\/td>\n<td> &nbsp;&nbsp;if&nbsp;($this_is_home_page) {<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 3<\/td>\n<td> &nbsp;&nbsp;&nbsp;require($template-&gt;get_template_dir(&#8216;\/tpl_random_default.php&#8217;,DIR_WS_TEMPLATE,$current_page_base,&#8217;templates&#8217;).&#8217;\/tpl_random_default.php&#8217;);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 4<\/td>\n<td> }<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<tbody>\n<tr>\n<td> 5<\/td>\n<td> &nbsp;?&gt;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5c06\u6587\u4ef6\u5939YOUR_TEMPLATE\u6539\u4e3a\u4f60\u6a21\u677f\u7684\u540d\u79f0 2.\u5c06includestemplatesYOUR_TEMPLATEtemplatestpl_random_default.php\u4e2d\u6587\u4ef6\u672b\u5c3e 1 &lt;script type=&#8221;text\/javascript&#8221;src=&#8221;includes\/templates\/YOUR_TEMPLATE\/jscript\/random.js&#8221;&gt;&lt;\/script&gt; \u4e2dYOUR_TEMPLATE\u6539\u4e3a\u4f60\u6a21\u677f\u7684\u540d\u79f0 3.\u4e0a\u4f20\u6587\u4ef6\u5373\u53ef \u4f7f\u7528\u65b9\u6cd5 \u5728\u9700\u8981\u8c03\u7528\u7684\u5730\u65b9\u589e\u52a0 1 &lt;?php 2 &nbsp;&nbsp;require($template-&gt;get_template_dir(&#8216;\/tpl_random_default.php&#8217;,DIR_WS_TEMPLATE,$current_page_base,&#8217;templates&#8217;).&#8217;\/tpl_random_default.php&#8217;); ?&gt; \u5c0f\u6280\u5de7 1.\u4fee\u6539\u968f\u673a\u4ea7\u54c1\u4e2a\u6570 \u4fee\u6539includestemplatesYOUR_TEMPLATEtemplatestpl_random_default.php 1 $num=10;\/\/\u968f\u673a\u4ea7\u54c1\u6570\u91cf 2.\u5220\u9664\u4ea7\u54c1\u540d\u79f0\u6216\u4ef7\u683c\uff0c\u5728includestemplatesYOUR_TEMPLATEtemplatestpl_random_default.php\u5c06\u6ce8\u91ca\u540d\u79f0\u548c\u4ef7\u683c\u7684\u4e0b\u7684\u4ee3\u7801\u6ce8\u91ca 3.\u66f4\u6539\u81ea\u52a8\u79fb\u52a8\u901f\u5ea6\uff0c\u5728includestemplatesYOUR_TEMPLATEjscriptrandom.js 1 AutoPlayObj = setInterval(&#8216;ISL_GoDown();ISL_StopDown();&#8217;,3000);&nbsp;\/\/\u95f4\u9694\u65f6\u95f4 \u6709\u670b\u53cb\u8bf4js\u6548\u679c\u4e0d\u6eda\u52a8\u7b49\u539f\u56e0\uff0c\u4f46\u662f\u6211\u81ea\u5df1\u5728\u9ed8\u8ba4\u6a21\u677f IE Firefox google chrome\u6d4b\u8bd5\u65f6\u90fd\u662f\u6b63\u5e38\u7684\uff0c\u4eca\u5929\u770b\u5230\u4e00\u6b3ejq\u7684\u56fe\u7247\u6eda\u52a8\u6548\u679c\u4e0d\u9519\uff0c\u7d22\u6027\u5c31\u5c06\u6362\u6765\u7684js\u6362\u6389\uff0c\u76f4\u63a5\u5957\u5230\u8fd9\u4e2a\u63d2\u4ef6\u91cc\u3002 \u5b89\u88c5\u65b9\u6cd5 1.\u5c06\u6587\u4ef6\u5939YOUR_TEMPLATE\u6539\u4e3a\u4f60\u6a21\u677f\u7684\u540d\u79f0 2.\u5c06includestemplatesYOUR_TEMPLATEcommonhtml_header.php\u4e2d 1 &lt;?php&nbsp;if&nbsp;(isset($canonicalLink) &amp;&amp;&nbsp;$canonicalLink&nbsp;!=&nbsp;&#8221;) { ?&gt; 2 &lt;link rel=&#8221;canonical&#8221;&nbsp;href=&#8221;&lt;?php echo $canonicalLink; ?&gt;&#8221;&nbsp;\/&gt; 3 &lt;?php } ?&gt; \u4e0b\u9762\u5f15\u5165google\u7684jq\u5e93 1 &lt;script src=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7.1\/jquery.min.js&#8221;type=&#8221;text\/javascript&#8221;&gt;&lt;\/script&gt; \u5982\u679c\u6a21\u677f\u4e2d\u5df2\u7ecf\u5f15\u5165jq\u5e93\uff0c\u5219\u53ef\u4ee5\u7701\u7565 3.\u4e0a\u4f20\u6587\u4ef6\u5373\u53ef \u6548\u679c\u63a7\u5236 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60925","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60925","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=60925"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60925\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}