{/dede:arclist}
20.seo标题给栏目设置seo标题、关键字、描述(https://www.dedecms8.com/dedecms/2835.html)
内容页调用SEO标题:在<title></title>之间加进以下代码:
{dede:field name='typeid' runphp='yes'}
$id=@me;
global $dsql;
$sql="select seotitle from dede_arctype where id=$id";
$row=$dsql->getOne($sql);
@me=$row["seotitle"];
{/dede:field}
内容页调用栏目描述:
把默认的<meta name="description" content="{dede:field.description function='html2text(@me)'/}" />改成:
<meta name="description" content="{dede:field name='typeid' runphp='yes'}
$id=@me;
global $dsql;
$sql="select description from dede_arctype where id=$id";
$row=$dsql->getOne($sql);
@me=$row["description"];
{/dede:field}" />
内容页调用栏目关键字:
把默认的<meta name="keywords" content="{dede:field.keywords/}" /> 改成:
<meta name="keywords" content="{dede:field name='typeid' runphp='yes'}
$id=@me;
global $dsql;
$sql="select keywords from dede_arctype where id=$id";
$row=$dsql->getOne($sql);
@me=$row["keywords"];
{/dede:field}" />
首页: