Last active
January 28, 2017 20:38
-
-
Save mzalewski/7365db7185c821645a2232df184f4247 to your computer and use it in GitHub Desktop.
WordPress Custom Post Type
This file contains hidden or 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 myplugin_add_post_type() { | |
register_post_type( 'reviews', | |
array( | |
'labels' => array( | |
'name' => __( 'Reviews' ), | |
'singular_name' => __( 'Review' ) | |
), | |
'public' => true, | |
'has_archive' => true, | |
'rewrite' => array('slug' => 'reviews'), | |
) | |
); | |
} | |
// Hooking up our function to theme setup | |
add_action( 'init', 'myplugin_add_post_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment