日期:2015-03-13 阅读:2081
dmandwp系统 - wordpress系统和DM系统区块建站>>
html.tpl的代码:
<head>
<?php print $head; ?>
<title><?php print $head_title; ?></title>
从上面代码看的出,head_title和$head是分开来的。$head我们在这里介绍过。
可以用模块 page_title
----------------
如果要动态取的一些内容的话,可以这样:
function avenev_preprocess_html(&$vars) {
if (arg(0) == 'news_views' and arg(1) == 'sport'){
$nodehere = node_load(arg(2));// pre($nodehere);
$seotitle= $nodehere->title;
$vars['head_title']=$seotitle;
}
----------------
http://www.milesjcarter.co.uk/blog/web-design-development/drupal-7-seo-controlling-page-titles-theme-layer/
function THEME_preprocess_html(&$vars) {
* in template.php
$vars['head_title'] = implode(' | ', array(drupal_get_title(), variable_get('site_name', ''), variable_get('site_slogan', '')));
For setting a title at the theme layer as “title (as in the h1 title) | site_name | site_slogan”
----------------------