Last active
September 13, 2015 13:07
-
-
Save remcotolsma/1b20dc42ce1beea39437 to your computer and use it in GitHub Desktop.
WordPress register_post_type() project with archive and rewite slug.
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 prefix_init() { | |
register_post_type( 'project', array( | |
'public' => true, | |
'label' => __( 'Projects', 'text_domain' ), | |
'has_archive' => true, | |
'rewrite' => array( 'slug' => _x( 'projects', 'slug', 'text_domain' ) ), | |
) ); | |
} | |
add_action( 'init', 'prefix_init' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment