How can I prevent Headers from being sent?
I am trying to list (WordPress) blog posts on a non-WordPress site (both sites share a public web folder).
I want to run the following PHP code to get the blog posts:
<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>
However, it seems running this code sends payload headers to client. Is there any way to retrieve the blog posts without sending headers?