如何防止发送邮件头?
我试图在非WordPress网站上列出(WordPress)博客帖子(两个网站共享一个公共web文件夹)。
我想运行以下PHP代码来获取博客帖子:
<ul class=\'list-unstyled\'>
<?php
define(\'WP_USE_THEMES\', false);
require($_SERVER[\'DOCUMENT_ROOT\'] . \'/blog/wp-load.php\');
query_posts(\'showposts=5\');
while (have_posts()): the_post();
?>
<li><i class=\'glyphicon glyphicon-menu-right\'></i>
<h4><a href="<?php the_permalink(); ?>" class="myred text-main"><?php the_title(); ?></a></h4>
<p><?php the_date(); ?> | Category: <?php the_category(\',\'); ?> | <?php the_tags(); ?></p>
</li>
<?php endwhile; ?>
</ul>
然而,运行此代码似乎会向客户端发送负载头。有没有办法在不发送标题的情况下检索博客帖子?