wordpress中的字符串中未显示新行


New line not shown in the string in wordpress

我正在使用代码打印标题和内容。标题显示在第一行,内容显示在下一行。我写的代码如下

 $title = get_the_title( $id )."<br><br>".get_post_field( 'post_content', $id );

但它只是在输出中打印<br>标记,而不是换行。

这样做,

$title = get_the_title( $id );
$content = get_post_field( 'post_content', $id );
echo $title."<br>".$content;

或_title();和_content();