Created
October 19, 2016 09:31
-
-
Save fernandiez/f2053c9e509587e772cc63ced38760a3 to your computer and use it in GitHub Desktop.
Custom permalink structure only for WordPress default posts
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
// Custom permalink structure only for default WordPress posts | |
// https://wordimpress.com/how-to-add-a-custom-permalink-structure-for-only-the-wordpress-default-post-type/ | |
add_action( 'init', 'my_new_default_post_type', 1 ); | |
function my_new_default_post_type() { | |
register_post_type( 'post', array( | |
'labels' => array( | |
'name_admin_bar' => _x( 'Post', 'add new on admin bar' ), | |
), | |
'public' => true, | |
'_builtin' => false, | |
'_edit_link' => 'post.php?post=%d', | |
'capability_type' => 'post', | |
'map_meta_cap' => true, | |
'hierarchical' => false, | |
'rewrite' => array( 'slug' => 'post' ), | |
'query_var' => false, | |
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ), | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment