Created
April 21, 2014 16:49
-
-
Save mikelyons/11148497 to your computer and use it in GitHub Desktop.
How to add a custom post type in wordpress 3.41
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 | |
add_action( 'init', 'create_post_type' ); | |
function create_post_type() { | |
register_post_type( 'press-releases', | |
array( | |
'public' => true, | |
'show_ui' => true, | |
'publicly_queryable' => true, | |
'has_archive' => true, | |
'capability_type' => 'post', | |
'rewrite' => array('slug' => ''), | |
'menu_position' => 4, | |
'supports' => array( 'press-releases', 'editor', 'title' ), | |
'has_archive' => true, | |
'labels' => array( | |
'name' => __( 'Press Releases' ), | |
'singular_name' => __( 'Press Release' ), | |
'edit_item' => __( 'Edit Press Release' ) | |
) | |
) | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment