Emlog文章标签作为关键词,提高百度收录
时间:2019-02-10 00:17:33
建议使用:
Notepad++来打开php文件,不要用记事本方法打开,记得提前备份养成良好习惯,以防意外
第一步、
找到当前模版文件夹下的header.php使用Notepad++打开,找到下面代码:直接 ctrl+F 搜索也行
<meta name="keywords" content="<?php echo $site_key; ?>" />
替换为下面代码:
<?php if(isset($logid)):?>
<meta name="keywords" content="<?php page_tag_key($logid);?>" />
<?php else: ?>
<meta name="keywords" content="<?php echo $site_key; ?>" />
<?php endif; ?>
第二步、
把下方代码复制到当前模版文件夹下的module.php文件里去
<?php
function page_tag_key($blogid){
global $CACHE;
$log_cache_tags = $CACHE->readCache('logtags');
if (!empty($log_cache_tags[$blogid])){
foreach ($log_cache_tags[$blogid] as $value){
$tag .= $value['tagname'].',';
}
echo substr($tag,0,-1);
}
}
上一篇:Emlog自定义修改浏览量
下一篇:Emlog文章-访问密码页面美化