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:
Column page:
Find around line 164 of include/typelink.class.php, find
$this->valuePositionName = $tinfos['typename'].$this->SplitSymbol.$this->valuePositionName;
and modify it to:
$this->valuePositionName = $this->valuePositionName.$this->SplitSymbol.$tinfos['typename'];
Next, add the list The default title tag
<title>{dede:field.title/} - {dede:global.cfg_webname/}</title>
on the page template can be changed to:
<title><title>{dede:field.优化title /} {dede:field.title function='ereg_replace(" - "," - ",@me)'/} - {dede:global.cfg_webname/}</title>
.
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['title'] = ereg_replace("[<>]"," / ",$this->TypeLink->GetPositionLink(false));
, delete / and be sure to leave a space" "
Article page :
<title>{dede:field.优化title/} {dede:field name='title'/}-{dede:field name='position' runphp='yes'} $tc="-"; //分隔符 $tw=$GLOBALS['cfg_list_symbol']; //调用位置分隔符 @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='cfg_webname'/}</title>
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!