And here is the correct implementation:
Register the category
taxonomy for the page
post-type:
function wpse121285_add_category_to_pages() {
register_taxonomy_for_object_type('category', 'page');
}
add_action( 'admin_init', 'wpse121285_add_category_to_pages' );
Add the appropriate category term to the desired page.
Then modify the default $wp_query
object at pre_get_posts
:
function wpse121285_pre_get_posts( $query ) {
// Main query for the blog posts index
// Note that you can use most/any contextual
// conditional here, depending on your needs
if ( is_home() && $query->is_main_query() ) {
$query->set( 'posts_per_page', 5 );
$query->set( 'category_name', 'news' );
$query->set( 'post_type', array( 'post', 'page' ) );
}
}
add_action( 'pre_get_posts', 'wpse121285_pre_get_posts' );
Leave the default Loop markup alone:
// No query_posts() needed here!
if ( have_posts() ) : while ( have_posts() ) : the_post();