In a plugin, I am building a custom page with
add_action('template_redirect', function(){
include(TEMPLATEPATH."/page.php");
exit();
});
add_filter('the_title', function(){ return "Virtual Page Title"; });
add_filter('the_content', function(){ ?>
<!-- HTML CONTENT -->
<?php }); ?>
But some templates wrap the page.php
content calls in a have_posts()
loop which I need to override for the virtual page. I have tried query_posts('posts_per_page=1')
but that requires that there is at least one published post, which may not always be the case.