2.1.3 首页不显示解决方法
小辰 • 2023-05-04 00:19 • 680 次点击 •
更新首页不显示解决方法
找到模板内的log_list.php文件
找到这个代码
if($pageurl == Url::logPage()){include View::getView('index');exit;}
改为
if(empty($sortid) && empty($tag) && empty($keyword) && empty($author) && $page == 1){include View::getView('index');exit;}
或者
if(BLOG_URL.trim(Dispatcher::setPath(), '/') == BLOG_URL){ include View::getView('index');exit;}
或者更简单的
if(empty(trim(Dispatcher::setPath(),'/'))){include View::getView('index');exit;}
临时解决方法相信下个版本Emlog作者会修复的
模板首页就显示了
评论:
蕊蕊博客 用户2023-05-03 23:35
if(BLOG_URL.trim(Dispatcher::setPath(), '/') == BLOG_URL){
include View::getView('index');
exit;
}
这个也不错
include View::getView('index');
exit;
}
这个也不错
小风SAMA 用户2023-05-03 18:42
/**
* 判断:是否是首页
* @return boolean
*/
function isIndex(){
if(BLOG_URL.trim(Dispatcher::setPath(), '/') == BLOG_URL){
return true;
}
return false;
}
这样更简单一点,默认模板带的函数。
* 判断:是否是首页
* @return boolean
*/
function isIndex(){
if(BLOG_URL.trim(Dispatcher::setPath(), '/') == BLOG_URL){
return true;
}
return false;
}
这样更简单一点,默认模板带的函数。