Created
May 14, 2019 19:55
-
-
Save brianpurkiss/6b82abc6281d11b940b8951c6a8152df to your computer and use it in GitHub Desktop.
Change the WP permalink structure of posts only
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 custom_blog_permalinks() { | |
global $wp_rewrite; | |
$wp_rewrite->set_permalink_structure( $wp_rewrite->root . '/blog/%postname%/' ); // custom post permalinks | |
} | |
add_action( 'init', 'custom_blog_permalinks' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment