2 Star 2 Fork 1

沉冰浮水/ZBP_THEME

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
header.php 2.63 KB
一键复制 编辑 原始数据 按行查看 历史
沉冰浮水 提交于 2024-08-16 14:50 +08:00 . pub-mzERK. 2024-08-16
<?php
// ----------------------------------------------------------------
// [3楼:不要跨文件闭合HTML标签]
// https://bbs.zblogcn.com/thread-101310.html#484040
// ----------------------------------------------------------------
?>
<head>
<meta charset="utf-8">
<meta name="generator" content="{$zblogphp}">
<meta name="viewport" content="width=device-width, initial-scale=1">
{if $type=='article'}
<title>{$title}_{$article.Category.Name}_{$name}</title>
{php}
$keywords = $article->TagsToNameString();
$description = preg_replace('/[\r\n\s]+/', ' ', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),135)).'...');
{/php}
<meta name="keywords" content="{$keywords}">
<meta name="description" content="{$description}">
<meta name="author" content="{$article.Author.StaticName}">
<link rel="canonical" href="{$article.Url}">
{elseif $type=='page'}
<title>{$title}_{$name}_{$subname}</title>
<meta name="keywords" content="{$title},{$name}">
{php}
$description = preg_replace('/[\r\n\s]+/', ' ', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),135)).'...');
{/php}
<meta name="description" content="{$description}">
<meta name="author" content="{$article.Author.StaticName}">
<link rel="canonical" href="{$article.Url}">
{elseif $type=='index'}
<title>{$name}{if $page>'1'}_第{$pagebar.PageNow}页{/if}_{$subname}</title>
<meta name="keywords" content="{$zbp->Config('mzERK')->keywords},{$name}">
<meta name="description" content="{$zbp->Config('mzERK')->description}_{$name}_{$title}">
<meta name="author" content="{$zbp.members[1].Name}">
<link rel="canonical" href="{$zbp.fullcurrenturl}">
{else}
{php}
$title = preg_replace('/\s.+$/','',$title);
$fixTitle = "";
$fixDesc = "";
if (isset($pagebar)){
$fixTitle = "_第{$pagebar->PageNow}页";
$fixDesc = "_当前是第{$pagebar->PageNow}页";
}
{/php}
<title>{$title}_{$name}{$fixTitle}</title>
<meta name="keywords" content="{$title},{$name}">
<meta name="description" content="{$title}_{$name}{$fixDesc}">
<meta name="author" content="{$zbp.members[1].Name}">
<link rel="canonical" href="{$zbp.fullcurrenturl}">
{/if}
<link rel="stylesheet" href="{$host}zb_users/theme/mzERK/style/{$style}.css?v=16437287">
{if $type=='index'&&$page=='1'}
<link rel="alternate" type="application/rss+xml" href="{$feedurl}" title="{$name}">
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="{$host}zb_system/xml-rpc/?rsd">
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="{$host}zb_system/xml-rpc/wlwmanifest.xml">
{/if}
<!--主题开发者不要省$header,$footer同理-->
{$header}
</head>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/wdssmq/ZBP_THEME.git
git@gitee.com:wdssmq/ZBP_THEME.git
wdssmq
ZBP_THEME
ZBP_THEME
master

搜索帮助