How to create custom page in WordPress

/* Custom Post Type Start */

custom page in wordpress


function create_posttype() {

register_post_type( 'partner',

// CPT Options


array(

  'labels' => array(

   'name' => __( 'partner' ),

   'singular_name' => __( 'partner' )

  ),

  'public' => true,

  'has_archive' => false,

  'rewrite' => array('slug' => 'partner'),

 )

);

}

// Hooking up our function to theme setup

add_action( 'init', 'create_posttype' );


/* Custom Post Type End */





We create a fileds  



/*Custom Post type start*/

function cw_post_type_news() {

$supports = array(

'title', // post title

'editor', // post content

'author', // post author

'thumbnail', // featured images

'excerpt', // post excerpt

'custom-fields', // custom fields

'comments', // post comments

'revisions', // post revisions

'post-formats', // post formats

);

$labels = array(

'name' => _x('news', 'plural'),

'singular_name' => _x('news', 'singular'),

'menu_name' => _x('news', 'admin menu'),

'name_admin_bar' => _x('news', 'admin bar'),

'add_new' => _x('Add New', 'add new'),

'add_new_item' => __('Add New news'),

'new_item' => __('New news'),

'edit_item' => __('Edit news'),

'view_item' => __('View news'),

'all_items' => __('All news'),

'search_items' => __('Search news'),

'not_found' => __('No news found.'),

);

$args = array(

'supports' => $supports,

'labels' => $labels,

'public' => true,

'query_var' => true,

'rewrite' => array('slug' => 'news'),

'has_archive' => true,

'hierarchical' => false,

);

register_post_type('news', $args);

}

add_action('init', 'cw_post_type_news');

/*Custom Post type end*/



Create templet feating list

<?php

/*Template Name: News*/

get_header();

query_posts(array(

   'post_type' => 'news'

)); ?>

<?php

while (have_posts()) : the_post(); ?>

<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>

<p><?php the_excerpt(); ?></p>

<?php endwhile;

get_footer();

?>