【发布时间】:2010-06-11 18:18:36
【问题描述】:
我注意到,当我从我的 wordpress 模板中调用 the_post() 或 the_content() 函数时,它会自动解析数据库数据以用<br/> 替换新行,用<p> 标签包装文本等...在 the_post() 或 the_content() 中可能有某种“格式”函数。
我写了一个查询来直接从 wp_posts 获取帖子。然后我打印出来像
<?php
$results = $wp->get_results($sql)
foreach($results as $row) echo $row->post_content; ?>
显然,wordpress 的“格式”功能不会解析这些数据。输出此内容的正确方法是什么,使其经历与 the_post() 或 the_content() 相同的“格式化”功能?
【问题讨论】:
标签: wordpress