Most of the wordpress blogs or themes display post in their home page, for one of my project I wanted to display pages in the home page template
This was the template code
get_option('theme_home_posts'),
'cat'=>'-'.get_cat_id(get_option('theme_featured')),
'paged'=>$paged,
);
query_posts($args);
while (have_posts()) : the_post(); ?>
To simplify the code, all the post with category theme_featured will display.
I have modified the code to
get_option('theme_home_posts'),
'paged'=>$paged,
'post_type' => 'page',
'post__in' => array(14,133,380,18,16,12)
);
query_posts($args);
while (have_posts()) : the_post(); ?>
I have removed the category option and included post type and post in option.
Post type defines if its a post or page and post in let wordpress know what post to include
Reffrence:
- http://codex.wordpress.org/Custom_Queries
- http://codex.wordpress.org/Class_Reference/WP_Query
- http://wordpress.org/support/topic/page-query-and-post-query-on-the-same-page
