It is possible to have 2 posting pages on a page? I have a static home page and I want to create 2 more pages for my blog which are "News" and "Recent Projects".
3 Answers
You can create page templates for your post listings and tune them depending on your requirements.
Take a look at this example for the latest posts.
Are you talking about a category page? See the docs Category Templates « WordPress Codex
When a viewer clicks on a link to one of the Categories on your site, he or she is taken to a page listing the Posts in that particular Category in chronological order, from newest Posts at the top to oldest at the bottom. There are many display choices, including whether to display the complete post or post excerpts, and what additional information to display (title, author, publish date, last modified time, etc.). Each theme makes different choices, and you might want to change them
Add a custom link to your menu for each category slug: http://codex.wordpress.org/WordPress_Menu_User_Guide
Try this to get rid of the category slug, too: Wordpress Plugins » WP No Category Base
Of course, you can. You have to create first new post types. You can do it in functions.php
:
add_action( 'init', 'register_cpt_YourPostType' );
function register_cpt_YourPostType() {
$labels = array(
'name' => _x( 'YourPostType', 'your-post-type' ),
'singular_name' => _x( 'YourPostType', 'your-post-type' ),
),
'menu_name' => _x( 'YourPostType', 'your-post-type' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => 'Your description',
'supports' => array( 'title', 'editor', 'thumbnail' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'slug' => 'your-post-type',
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => true,
'capability_type' => 'post'
);
register_post_type( 'your-post-type', $args );
}
/**********************************************************************/
And then, use your desired post type in every template:
$type = 'your-post-type';
$args = array (
'post_type' => $type,
'post_status' => 'publish',
'posts_per_page' => -1,
'ignore_sticky_posts'=> 1
);
$temp = $wp_query; // assign ordinal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
if($wp_query->have_posts()) {
while ( $wp_query->have_posts() ) : $wp_query->the_post();
...