我正在使用代码打印标题和内容。标题首先显示,内容显示在下一行。我编写的代码如下
$title = get_the_title( $id )."<br><br>".get_post_field( 'post_content', $id );
但它只是在输出中打印<br>
标记,不会破坏该行。
答案 0 :(得分:0)
做这样的事,
$title = get_the_title( $id );
$content = get_post_field( 'post_content', $id );
echo $title."<br>".$content;
或the_title();和the_content();