在元标记中使用换行符

时间:2011-01-14 18:11:17

标签: php html meta-tags line-breaks

我想在我的网站描述元标记中使用换行符。我该怎么做,因为如果我看到源代码,它仍然只显示<br/>。我在代码中使用的是这样的东西:

<meta name="description" content="<?php echo $gotAlias ?><br/>
abc: <?php echo $got_overallrating ?>.<br/>
<a href='www.abc.com'>Visit www.abc.com</a>
">

3 个答案:

答案 0 :(得分:3)

要在AddThis元内容标记中使用,\ n将被忽略。 所以它不起作用。

答案 1 :(得分:0)

//META TAGS
add_action( 'wp_head', 'tws_output_meta_tags', 5 );
function tws_output_meta_tags() {
    echo '<meta name="author" content="content text" />'."\n";   

}

答案 2 :(得分:-1)

尝试使用"\n"代替<br />,例如<?php echo "first line\nsecond line"; ?>;