本文整理自网络,侵删。
织梦dedecms自带手机端网站搜索页默认是直接跳转到pc站的搜索页面,需要实现的效果是手机站搜索跳转到手机站搜索页面。
方法:
找到/plus/search.php 这个文件,搜索如下代码,大概在20行左右
$mid = (isset($mid) && is_numeric($mid)) ? $mid : 0;
在这段代码的下面添加:
$mobile = (isset($mobile) && is_numeric($mobile)) ? $mobile : 0; if ( $mobile==1 ) { define('DEDEMOB', 'Y'); }
然后在搜索页的地方form中添加一个隐藏的input,name为mobile,value值为1,如下代码:
<input type="hidden" name="mobile" value="1" />
如图所示,操作完上面两部后手机端搜索页面已经可以自动跳转到search_m.htm页面。
标签:织梦DedeCMS
相关阅读 >>
dedecms v5.7提示php.ini register_globals must is off错误的解决方法
dedecms的dedesql.class.php on line 489错误的解决方法
更多相关阅读请进入《织梦DedeCMS》频道 >>