pbootcms模板中修改网站标题显示方式去掉副标题

pbootcms模板中修改网站标题显示方式去掉副标题

使用pbootcms模板时发现副标题在前台列表页、详情页、文章页的均有显示,如:文章标题-站点标题-副标题。本教程教你如何对标题进行优化,让标题显示为:文章标题-站点标题这样格式,下面开始教程:

1、打开apps/home/controller/IndexController.php 找到列表页、详情页、单页

2、修改对应的标题代码

列表页修改:

$content = str_replace('{pboot:pagetitle}', $pagetitle . '-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);

// 列表页这段代码修改成以下
$content = str_replace('{pboot:pagetitle}', $pagetitle . '-{pboot:sitetitle}', $content);

详情页修改:

$content = str_replace('{pboot:pagetitle}', '{content:title}-{sort:name}-{pboot:sitesubtitle}', $content);

// 详情页这段代码改成以下
$content = str_replace('{pboot:pagetitle}', '{content:title}-{pboot:sitetitle}', $content);

文章页修改:

$content = str_replace('{pboot:pagetitle}', $pagetitle . '-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);

// 单页页这段代码改成以下
$content = str_replace('{pboot:pagetitle}', $pagetitle . '-{pboot:sitetitle}', $content);

V1.1.6+新增如下标签,推荐使用

{pboot:pagetitle} 根据不同页面自动显示标题

{pboot:pagekeywords} 根据不同页面自动显示关键字

{pboot:pagedescription} 根据不同页面自动显示描述

原文链接:https://88hzy.cn/1993.html,转载请注明出处。

0

评论0

请先

显示验证码
没有账号? 注册  忘记密码?