Created
June 29, 2016 13:53
-
-
Save Venugopal155/4fbca96da03c80fbfe23f9f030481958 to your computer and use it in GitHub Desktop.
Custom post type register in wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function amas_register() { | |
$labels = array( | |
'name' => _x('AMAs', 'post type general name'), | |
'singular_name' => _x('AMAs', 'post type singular name'), | |
'add_new' => _x('Add AMA', 'AMAs'), | |
'add_new_item' => __('Add New AMA'), | |
'edit_item' => __('Edit AMA'), | |
'new_item' => __('New AMA'), | |
'view_item' => __('View AMA'), | |
'search_items' => __('Search AMA'), | |
'not_found' => __('Nothing found'), | |
'not_found_in_trash' => __('Nothing found in Trash'), | |
'parent_item_colon' => '' | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'amas', 'with_front' => false ), | |
// 'rewrite' => true, | |
'capability_type' => 'post', | |
'hierarchical' => false, | |
//'menu_icon' => '', | |
'menu_position' => 8, | |
'supports' => array('title','editor','thumbnail','custom-fields') | |
); | |
register_post_type( 'amas' , $args ); | |
flush_rewrite_rules(); | |
} | |
add_action('init', 'amas_register'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment