Home > CMS Tutorial > DEDECMS > body text

How to modify the TITLE tag on the DEDECMS web page

藏色散人
Release: 2020-01-03 09:03:56
Original
2982 people have browsed it

How to modify the TITLE tag on the DEDECMS web page

How to modify the TITLE tag of DEDECMS web page?

DEDECMS web page TITLE tag modification is conducive to optimization

It is said that Baidu is basically We don’t even look at the keyword (of course we have to write it), but the key now is the title on the web page. So be sure to do a good job with the title. It mainly involves the issue of how to implement "third-level column_second-level column_first-level column_website name". Nowadays, the titles of most websites are basically like this:

Recommended learning: 梦Weavercms

Home page:

{dede:global.cfg_webname/}, in "System Settings" → "Basic System Parameters", write the title information of the homepage in the website name.

Column page:

Find around line 164 of include/typelink.class.php, find

$this->valuePositionName = $tinfos['typename'].$this->SplitSymbol.$this->valuePositionName;
Copy after login

and modify it to:

$this->valuePositionName = $this->valuePositionName.$this->SplitSymbol.$tinfos['typename'];
Copy after login

Next, add the list The default title tag

<title>{dede:field.title/} - {dede:global.cfg_webname/}</title>
Copy after login

on the page template can be changed to:

<title><title>{dede:field.优化title /} {dede:field.title function=&#39;ereg_replace(" - "," - ",@me)&#39;/} - {dede:global.cfg_webname/}</title>
Copy after login

.

The first tag {dede:field.optimized title /} is the optimized title of the calling column. If you are not satisfied with the connector in the middle of the column, you can modify include/arc.listview.class.php, find line 55

$this->Fields[&#39;title&#39;] = ereg_replace("[<>]"," / ",$this->TypeLink->GetPositionLink(false));
Copy after login

, delete / and be sure to leave a space" "

Article page :

<title>{dede:field.优化title/} {dede:field name=&#39;title&#39;/}-{dede:field name=&#39;position&#39; runphp=&#39;yes&#39;} 
$tc="-"; //分隔符 
$tw=$GLOBALS[&#39;cfg_list_symbol&#39;]; //调用位置分隔符 
@me=html2text(@me); //去除html标签 
$tf=split($tw,@me); //分解成数组 
for($ta=(count($tf)-2);$ta>=1;$ta--){ //循环赋值给$tk 
$tk.=trim($tf[$ta]).$tc; 
} 
$tk=substr($tk,0,-1); 
@me=$tk; //赋值给@me 
{/dede:field}-{dede:global name=&#39;cfg_webname&#39;/}</title>
Copy after login

Effect: Realize "third-level column_second-level column_first-level column_website name". What is the abbreviated title {dede:field.optimized title/} used for? That’s right—long-tail keywords.

The above is the detailed content of How to modify the TITLE tag on the DEDECMS web page. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template