Write this code in your function.php file.
function my_custom_post_homepage() {
$labels = array(
'name' => _x( 'Homepage', 'post type general name' ),
'singular_name' => _x( 'Homepage', 'post type singular name' ),
'add_new' => _x( 'Add New', 'news' ),
'add_new_item' => __( 'Add New Homepage' ),
'edit_item' => __( 'Edit Homepage' ),
'new_item' => __( 'New Homepage' ),
'all_items' => __( 'All Homepage' ),
'view_item' => __( 'View Homepage' ),
'search_items' => __( 'Search Homepage' ),
'not_found' => __( 'No homepage found' ),
'not_found_in_trash' => __( 'No homepage found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Homepage'
);
$args = array(
'labels' => $labels,
'description' => 'Holds our homepage specific data',
'public' => true,
'menu_position' => 5,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),
'has_archive' => true,
);
register_post_type( 'homepage', $args );
}
add_action( 'init', 'my_custom_post_homepage' );
<p>Add this code where you want to show custom posts</p>
<div id="custompst">
<?php query_posts( 'post_type=homepage'); ?>
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<li><a href="<?php the_permalink(); ?>" rel="bookmark"><h1 class="adsnameleft"><?php the_title(); ?></h1></a></li>
<li><span class="date"><?php the_time(get_option('date_format')); ?></span></li>
<div class="custom-post-entry">
<?php the_content();?>
<div class="clear"></div>
</div><!--post-entry end-->
<?php endwhile; ?>
</div> <!--custompst end-->
<p>Add your css for custom posts </p>
#custompst{
width:500px;
height:auto;
float:left;
margin-top:15px;
}
.custom-post-entry{
width:400px;
height:auto;
float:left;
}
.adsnameleft{
background: none repeat scroll 0 0 rgb(185, 185, 185);
width:400px;