Skip to content

Instantly share code, notes, and snippets.

@fernandopetry
Forked from xafarali/register Post type.php
Last active August 29, 2015 14:28
Show Gist options
  • Save fernandopetry/4157fd08123826bcb37f to your computer and use it in GitHub Desktop.
Save fernandopetry/4157fd08123826bcb37f to your computer and use it in GitHub Desktop.
Register Post Type
///////////////////////////////////
// Custom Post Type , Video
///////////////////////////////////
// Custom Post - Project
function create_banner() {
// label for post type project.
$labels = array(
'name' => 'Banners',
'singular_name' => 'Banner',
'add_new' => 'Add New ',
'add_new_item' => 'Add New Banner',
'edit' => 'Edit',
'edit_item' => 'Edit Banner',
'new_item' => 'New Banner',
'view' => 'View Banner',
'view_item' => 'View Banner',
'search_items' => 'Search Banner',
'not_found' => 'No Banner found',
'not_found_in_trash' => 'No Banner found in Trash',
'parent' => 'Parent Banner'
);
// registering Post - Project
register_post_type('banner', array(
'labels' => $labels,
'public' => true,
'description' => 'Banner for Cash Car for Kings.',
'supports' => array(
'title',
'editor',
'thumbnail'
),
'rewrite' => array(
'slug' => 'Banner-archive'
),
'menu_position' => 12,
'menu_icon' => get_stylesheet_directory_uri() . '/images/banner.png',
'public' => true,
'publicly_queryable' => false,
'show_ui' => true,
'has_archive' => true /*,
'taxonomies' => array(
'post_tag',
'category'
)*/
));
}
# register Post in init
add_action('init', 'create_banner');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment