织梦文章标题调用文章分类名称的方法

2022-08-18

不得不再说下dedecms实在是过于臃肿了...一个简单的标题seo也得折腾一下才行。
dedecms默认模板的文章页标题格式是“文章标题”_“网站名称”,稍微知道点seo的就会跟我们说这个标题不好,要改!要把分类名称全部加进去,不管是几级分类下都要把栏目名称加进去!
经过折腾后完成,最终实现后的文章标题为:“文章标题”_"栏目名称(一级二级三级都会显示)"_“网站名称”。
直接上代码:
01 </div> </div> </div> </div> <div class="col-lg-3 hidden-xs" style="float:right"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">精选网站</h3> </div> <div class="zx panel-body"> <ul> <li><a href="/topjd/1052/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="188导航收录网" width="16" height="16" />188导航收录网</a></li> <li><a href="/topjd/1055/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="魔司秒收录" width="16" height="16" />魔司秒收录</a></li> <li><a href="/topjd/1061/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="老李收录网" width="16" height="16" />老李收录网</a></li> <li><a href="/topjd/1064/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="创新屋百科网" width="16" height="16" />创新屋百科网</a></li> <li><a href="/topjd/1067/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="站长聚集地" width="16" height="16" />站长聚集地</a></li> <li><a href="/topjd/1089/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="魔司技术导航" width="16" height="16" />魔司技术导航</a></li> <li><a href="/topjd/1092/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="吾爱技术导航" width="16" height="16" />吾爱技术导航</a></li> <li><a href="/topjd/852/www.ahqutao.cn.html" target="_blank"><img src="" onerror="javascript:this.src='/favicon.ico';" alt="sh991网址导航" width="16" height="16" />sh991网址导航</a></li> </ul> </div> </div> <div class="panel panel-default"> <div class="panel-heading"><h3 class="panel-title">文章分类</h3></div> <div class="zx panel-body"> <ul> <li><a href="/article/1.html" target="_blank">互联网资讯</a></li> <li><a href="/article/2.html" target="_blank">站长资讯</a></li> <li><a href="/article/3.html" target="_blank">源码下载</a></li> <li><a href="/article/4.html" target="_blank">活动线报</a></li> <li><a href="/article/5.html" target="_blank">科普百科</a></li> </ul> </div> </div> </div> <div class="clear"></div> <div class="foot panel panel-default"> <div class="panel-body"> <p><a href="/">非凡技术导航</a> 优秀网址导航免费网站收录 <a href="/sitemap.xml">网站地图</a></p> <p>本站收录的网站若侵害到您的利益,请联系我们删除处理</p> <p> Copyright ©2020 <a href="http://www.guojiz.com" target="_blank">Guojiz V 5.5</a>All Rights Reserved. </p> <p> (<a href="http://www.miitbeian.gov.cn" style="margin-right: 0">备案号</a> )| <a href="http://wpa.qq.com/msgrd?v=3&uin=452133545&site=qq&menu=yes" target="_blank" style="margin-right: 0">452133545</a>|<script type="text/javascript" src="//api.tongjiniao.com/c?_=603875124007272448" async></script> <script> (function(){ var el = document.createElement("script"); el.src = "https://lf1-cdn-tos.bytegoofy.com/goofy/ttzz/push.js?34b5bfd3192b92e20a99666125074e7d0f12b59ea460d8504b408f9fb99c3007fd9a9dcb5ced4d7780eb6f3bbd089073c2a6d54440560d63862bbf4ec01bba3a"; el.id = "ttzz"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(el, s); })(window) </script> </p> </div> </div> </div> </body> </html>