织梦手机端搜索结果不调用电脑版搜索结果模板

2025-08-03 0 4
有使用dedecms最新程序移动版的同学肯定遇到过,手机版搜索结果跳转到的是电脑版搜索结果页面去了。
解决方法
1、在手机站模板的搜索框代码上加入 <input type=”hidden” name=”mobile” value=”1″ />
action用电脑站的/plus/search.php ,如下
<form name=”formsearch” action=”{dede:global.cfg_basehost/}/plus/search.php”>
    <input type=”hidden” name=”pagesize” value=”15″>
    <input type=”hidden” name=”kwtype” value=”0″/>
    <input type=”hidden” name=”mobile” value=”1″ />
    <input name=”q” type=”text” placeholder=”输入关键词”>
    <button type=”submit”>搜索</button>
</form>
2、打开 /plus/search.php 找到
$mid = (isset($mid) && is_numeric($mid)) ? $mid : 0;
在它的下面加入
if($mobile==1) define(‘DEDEMOB’, ‘Y’);
3、打开 /include/arc.searchview.class.php 找到
$purl .= “?”.$geturl;
在它上面加入
if(defined(‘DEDEMOB’))$geturl .= “mobile=1&”;
这样修改后,移动站的搜索结果模板就是 search_m.htm ,搜索结果就可以显示为移动站的了
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

版权声明:所有的源码、软件和资料,不得使用于非法商业用途,不得违反国家法律,一切关于该资源商业行为与本站无关。

免费cms模板 dedecms教程 织梦手机端搜索结果不调用电脑版搜索结果模板 https://www.mianfeicms.com/761.html

相关文章

发表评论
暂无评论